derby
Version:
MVC framework making it easy to write realtime, collaborative applications that run in both Node.js and browsers.
53 lines (52 loc) • 1.8 kB
TypeScript
import { App, AppOptions } from './App';
import { type Derby } from './Derby';
import { type StyleCompilerOptions } from './files';
import { PageForServer } from './PageForServer';
interface Agent {
send(message: Record<string, unknown>): void;
}
type CompilerFunction = (file: string, filename?: string, options?: unknown) => string;
export declare class AppForServer extends App {
agents: Record<string, Agent>;
compilers: Record<string, CompilerFunction>;
scriptBaseUrl: string;
scriptCrossOrigin: boolean;
scriptFilename: string;
scriptMapBaseUrl: string;
scriptMapFilename: string;
scriptMapUrl: string;
scriptUrl: string;
serializedBase: string;
serializedDir: string;
styleExtensions: string[];
viewExtensions: string[];
watchFiles: boolean;
router: any;
constructor(derby: Derby, name: string, filename: string, options?: AppOptions);
_init(options: any): void;
private _initBundle;
private _initRefresh;
_initLoad(): void;
private _initViews;
createPage(req: any, res: any, next: any): PageForServer;
bundle(_backend: any, _options: any, _cb: any): void;
writeScripts(_backend: any, _dir: any, _options: any, _cb: any): void;
private _viewsSource;
serialize(): void;
deserialize(): void;
loadViews(filename: string, namespace?: string): this;
loadStyles(filename: string, options?: StyleCompilerOptions): this;
private _loadStyles;
private _watchViews;
private _watchStyles;
private _watchBundle;
private _updateScriptViews;
private _autoRefresh;
private _handleMessageServer;
private _addAgent;
private _refreshClients;
private _refreshStyles;
middleware(backend: any): any[];
initAutoRefresh(backend: any): void;
}
export {};