diff --git a/types/ghost-storage-base/ghost-storage-base-tests.ts b/types/ghost-storage-base/ghost-storage-base-tests.ts index c7cec6c41a..dc368982dc 100644 --- a/types/ghost-storage-base/ghost-storage-base-tests.ts +++ b/types/ghost-storage-base/ghost-storage-base-tests.ts @@ -1,4 +1,4 @@ -import { StorageBase, Image, ReadOptions } from 'ghost-storage-base'; +import StorageBase, { Image, ReadOptions } from 'ghost-storage-base'; import { Request, Response, NextFunction } from 'express'; class MyCustomAdapter extends StorageBase { diff --git a/types/ghost-storage-base/index.d.ts b/types/ghost-storage-base/index.d.ts index d5f053cfe5..4f68a0fb68 100644 --- a/types/ghost-storage-base/index.d.ts +++ b/types/ghost-storage-base/index.d.ts @@ -2,30 +2,34 @@ // Project: https://github.com/TryGhost/Ghost-Storage-Base // Definitions by: Demian // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 +// TypeScript Version: 2.7 import { Handler } from 'express'; -export interface Image { - path: string; - name: string; - type: string; +declare namespace StorageBase { + interface Image { + path: string; + name: string; + type: string; + } + + interface ReadOptions { + path: string; + } } -export interface ReadOptions { - path: string; -} - -export abstract class StorageBase { +declare abstract class StorageBase { constructor(); abstract exists(fileName: string, targetDir?: string): Promise; - abstract save(image: Image, targetDir?: string): Promise; + abstract save(image: StorageBase.Image, targetDir?: string): Promise; abstract serve(): Handler; abstract delete(fileName: string, targetDir?: string): Promise; - abstract read(options?: ReadOptions): Promise; + abstract read(options?: StorageBase.ReadOptions): Promise; getTargetDir(baseDir?: string): string; - getUniqueFileName(image: Image, targetDir: string): string; + getUniqueFileName(image: StorageBase.Image, targetDir: string): string; getSanitizedFileName(fileName: string): string; } + +export = StorageBase; diff --git a/types/ghost-storage-base/tsconfig.json b/types/ghost-storage-base/tsconfig.json index c7591e2df1..e4aadd158f 100644 --- a/types/ghost-storage-base/tsconfig.json +++ b/types/ghost-storage-base/tsconfig.json @@ -9,6 +9,7 @@ "strictFunctionTypes": true, "strictNullChecks": true, "baseUrl": "../", + "esModuleInterop": true, "typeRoots": [ "../" ],