@bscotch/sprite-source
Version:
Art pipeline scripting module for GameMaker sprites.
25 lines • 1.2 kB
TypeScript
import { Pathy } from '@bscotch/pathy';
export type AnyFunc = (...args: any) => any;
export type Checked<T extends AnyFunc> = [error: Error, result: null] | [error: null, result: ReturnType<T>];
export type AsyncableChecked<T extends AnyFunc> = ReturnType<T> extends Promise<any> ? Promise<Checked<T>> : Checked<T>;
export declare function check<T extends AnyFunc>(func: T, message: string): AsyncableChecked<T>;
export declare class SpriteSourceError extends Error {
constructor(message: string, cause?: any, asserter?: Function);
}
export declare function assert(condition: any, message: string, cause?: any): asserts condition;
export declare function rethrow(cause: any, message: string): void;
export declare function getDirs(rootFolder: string, maxDepth?: number): Promise<Pathy[]>;
/**
* Delete the PNG images inside a folder. Returns the list of
* deleted images.
*/
export declare function deletePngChildren(path: Pathy): Promise<Pathy<unknown>[]>;
/**
* Asynchronously get the size of a PNG image, given its path,
* with maximal speed.
*/
export declare function getPngSize(path: Pathy): Promise<{
width: number;
height: number;
}>;
//# sourceMappingURL=utility.d.ts.map