5.1.2 • Published 4 years ago

@types/keystonejs__file-adapters v5.1.2

Weekly downloads
31
License
MIT
Repository
github
Last release
4 years ago

Installation

npm install --save @types/keystonejs__file-adapters

Summary

This package contains type definitions for @keystonejs/file-adapters (https://github.com/keystonejs/keystone).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/keystonejs__file-adapters.

index.d.ts

// Type definitions for @keystonejs/file-adapters 5.1
// Project: https://github.com/keystonejs/keystone
// Definitions by: Kevin Brown <https://github.com/thekevinbrown>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.5

// Because this is a scoped package, without this line Typescript doesn't associate the
// types with the right package.
// tslint:disable-next-line:no-single-declare-module
declare module '@keystonejs/file-adapters' {
    interface LocalFileAdapterConfig {
        src: string;
        path?: string | undefined;
        getFilename?: ((options: { id: string; originalFilename: string }) => string) | undefined;
    }

    class LocalFileAdapter {
        constructor(options: LocalFileAdapterConfig);

        save(params: {
            stream: any;
            filename?: string | undefined;
            id: string;
        }): Promise<{ filename: string; id: string }>;
        publicUrl(params: { filename: string }): string;
    }

    interface CloudinaryFileAdapterConfig {
        cloudName: string;
        apiKey: string;
        apiSecret: string;
        folder?: string | undefined;
    }

    class CloudinaryFileAdapter {
        constructor(options: CloudinaryFileAdapterConfig);

        save(params: {
            stream: any;
            filename?: string | undefined;
            id: string;
        }): Promise<{ filename: string; id: string }>;
        publicUrl(params: { filename: string }): string;
    }
}

Additional Details

  • Last updated: Thu, 08 Jul 2021 16:23:14 GMT
  • Dependencies: none
  • Global values: none

Credits

These definitions were written by Kevin Brown.