@nlabs/gothamjs
Version:
Platform
38 lines (37 loc) • 1.63 kB
TypeScript
import { GothamConfiguration } from '../views/Gotham/GothamProvider.js';
import type { FluxAction } from '@nlabs/arkhamjs';
import type { ReactElement } from 'react';
export interface GothamNotifyAction {
readonly icon?: string;
readonly label?: string;
readonly onClick: (key: string) => void;
}
export type GothamSeverity = 'error' | 'info' | 'success' | 'warning';
export interface GothamNotifyParams {
readonly actions?: GothamNotifyAction[];
readonly anchorOrigin?: {
horizontal: 'left' | 'center' | 'right';
vertical: 'top' | 'bottom';
};
readonly autoHideDuration?: number;
readonly key?: string;
readonly message?: ReactElement | string;
readonly severity?: GothamSeverity;
}
export interface NavParams {
path: string;
state?: Record<string, unknown>;
}
export declare const GothamActions: {
readonly init: () => Promise<FluxAction>;
readonly loading: (isLoading: boolean, content?: string) => Promise<FluxAction>;
readonly navBack: () => Promise<FluxAction>;
readonly navForward: () => Promise<FluxAction>;
readonly navGoto: (path: string, params?: Record<string, unknown>) => Promise<FluxAction>;
readonly navReplace: (path: string, params?: Record<string, unknown>) => Promise<FluxAction>;
readonly notify: (params: GothamNotifyParams) => Promise<FluxAction>;
readonly notifyClose: () => Promise<FluxAction>;
readonly setConfig: (config: GothamConfiguration) => Promise<FluxAction>;
readonly signOut: () => Promise<FluxAction>;
readonly updateTitle: (title: string, separator?: string) => Promise<FluxAction>;
};