Skip to content

Commit

Permalink
fix import (#36895)
Browse files Browse the repository at this point in the history
  • Loading branch information
thde authored and andrewbranch committed Jul 15, 2019
1 parent bdcb1ea commit d0f9f81
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion 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 {
Expand Down
28 changes: 16 additions & 12 deletions types/ghost-storage-base/index.d.ts
Expand Up @@ -2,30 +2,34 @@
// Project: https://github.com/TryGhost/Ghost-Storage-Base
// Definitions by: Demian <https://github.com/thde>
// 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;
}

export interface ReadOptions {
path: string;
interface ReadOptions {
path: string;
}
}

export abstract class StorageBase {
declare abstract class StorageBase {
constructor();

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

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

export = StorageBase;
1 change: 1 addition & 0 deletions types/ghost-storage-base/tsconfig.json
Expand Up @@ -9,6 +9,7 @@
"strictFunctionTypes": true,
"strictNullChecks": true,
"baseUrl": "../",
"esModuleInterop": true,
"typeRoots": [
"../"
],
Expand Down

0 comments on commit d0f9f81

Please sign in to comment.