@types/ghost-storage-base
TypeScript icon, indicating that this package has built-in type declarations

0.0.4 • Public • Published

Installation

npm install --save @types/ghost-storage-base

Summary

This package contains type definitions for ghost-storage-base (https://github.com/TryGhost/Ghost-Storage-Base).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ghost-storage-base.

index.d.ts

import { Handler } from "express";

declare namespace StorageBase {
    interface Image {
        path: string;
        name: string;
        type: string;
    }

    interface ReadOptions {
        path: string;
    }
}

declare abstract class StorageBase {
    constructor();

    abstract exists(fileName: string, targetDir?: string): Promise<boolean>;
    abstract save(image: StorageBase.Image, targetDir?: string): Promise<string>;
    abstract serve(): Handler;
    abstract delete(fileName: string, targetDir?: string): Promise<boolean>;
    abstract read(options?: StorageBase.ReadOptions): Promise<Buffer>;

    getTargetDir(baseDir?: string): string;
    getUniqueFileName(image: StorageBase.Image, targetDir: string): string;
    getSanitizedFileName(fileName: string): string;
}

export = StorageBase;

Additional Details

  • Last updated: Tue, 07 Nov 2023 03:09:37 GMT
  • Dependencies: @types/express

Credits

These definitions were written by Demian.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/ghost-storage-base

Weekly Downloads

155

Version

0.0.4

License

MIT

Unpacked Size

4.31 kB

Total Files

5

Last publish

Collaborators

  • types