sequelize-store
Version:
Key Value store backed by Sequelize
17 lines (16 loc) • 720 B
TypeScript
export interface StoreOptions {
tableName?: string;
}
export declare type Type = 'int' | 'float' | 'bool' | 'string' | 'json';
export declare type NativeTypes = number | boolean | string | object;
export interface ValueOptions {
type: Type;
default?: NativeTypes;
}
export declare type Schema = Record<string, ValueOptions | Type>;
export declare type StoreObject = Record<string, NativeTypes>;
export declare function isType(t: any): t is Type;
export declare function getType(t: any): Type;
export declare function parseType(data: string, type: Type): NativeTypes;
export declare function validateType(data: any, type: Type): boolean;
export declare function isValueOptions(obj: any): obj is ValueOptions;