@ztimson/momentum
Version:
Client library for momentum
27 lines • 849 B
TypeScript
import { Api } from './api';
import { Cache, PathEventEmitter } from '@ztimson/utils';
/** Momentum variable */
export type Setting<T> = {
/** Internal ID */
_id?: string;
/** Variable name */
key: string;
/** Variable value */
value: T;
/** Visible without authenticating */
public?: boolean;
/** Momentum variable, cannot be deleted */
system?: boolean;
};
export declare class Settings extends PathEventEmitter {
readonly api: Api;
cache: Cache<string, any>;
constructor(api: Api | string);
all(detailed?: boolean, reload?: boolean): Promise<{
[key: string]: any;
}>;
delete(key: string): Promise<void>;
read(key: string, reload?: boolean): Promise<Setting<any> | null>;
update(variable: Setting<any>): Promise<Setting<any>>;
}
//# sourceMappingURL=settings.d.ts.map