@ztimson/momentum
Version:
Client library for momentum
109 lines • 3.6 kB
TypeScript
import { Database, HttpDefaults } from '@ztimson/utils';
import { Actions } from './actions';
import { Ai } from './ai';
import { Analytics } from './analytics';
import { Api } from './api';
import { Audit } from './audit';
import { Auth } from './auth';
import { Call } from './call';
import { Discounts } from './discounts';
import { Email } from './email';
import { Notifications } from './notifications';
import { Data } from './data';
import { Forms } from './forms';
import { Groups } from './groups';
import { Logger, LogLevel } from './logger';
import { Routes } from './routes';
import { Templates } from './templates';
import { Transactions } from './transactions';
import { Pdf } from './pdf';
import { Products } from './products';
import { Schemas } from './schemas';
import { Sms } from './sms';
import { Socket } from './sockets';
import { Storage } from './storage';
import { Client } from './client';
import { Tokens } from './tokens';
import { Users } from './users';
import { Settings } from './settings';
import { Static } from './static';
import { PathEvent, PathEventEmitter } from './core';
import { WebRtc } from './webRtc';
import { Permissions } from './permissions';
export type MomentumOptions = {
/** Name of application for logging */
app: string;
/** Track analytics (anonymous - collect anonymously, force - force with PID, prompt - prompt for PID, manual - manually decide via code, false - disable, or string - use existing analytics ID) */
analytics: 'anonymous' | 'force' | 'prompt' | 'manual' | false | string;
/** Display console banner */
banner: boolean;
/** URL to checkout page */
checkoutUrl: string;
/** How to pass credentials to api */
credentialsStrategy: 'auto' | 'cookie' | 'header';
/** What to do on 401 errors */
expiredStrategy: 'ignore' | 'logout' | 'reload';
/** Set HTTP defaults for all API calls */
http?: HttpDefaults;
/** Install prompt frequency */
installPrompt: {
/** Prompt to install after X minutes */
delay: number;
/** Ask again after X days */
retry: number;
};
/** Automatically save console events that meet loglevel */
logLevel: LogLevel;
/** Path to login page */
loginUrl: string;
/** Enable offline support */
offline: boolean;
/** Persist user token & settings between sessions */
persist: boolean;
/** Connect to socket for live updates */
socket: boolean;
/** URL to web worker or false to disable */
worker: string | false;
};
export declare class Momentum extends PathEventEmitter {
static readonly pathEvent: typeof PathEvent;
static readonly version: string;
readonly pathEvent: typeof PathEvent;
readonly version: string;
readonly opts: MomentumOptions;
readonly url: URL;
api: Api;
actions: Actions;
ai: Ai;
analytics: Analytics;
audit: Audit;
auth: Auth;
call: Call;
client: Client;
data: Data;
database: Database;
discounts: Discounts;
email: Email;
forms: Forms;
groups: Groups;
logger: Logger;
notifications: Notifications;
pdf: Pdf;
permissions: Permissions;
products: Products;
routes: Routes;
schemas: Schemas;
settings: Settings;
sms: Sms;
socket?: Socket;
static: Static;
storage: Storage;
templates: Templates;
tokens: Tokens;
transactions: Transactions;
users: Users;
webRtc: WebRtc;
get banner(): string;
constructor(url?: string, opts?: Partial<MomentumOptions>);
}
//# sourceMappingURL=momentum.d.ts.map