98 lines
2.7 KiB
TypeScript
98 lines
2.7 KiB
TypeScript
|
|
||
|
/* File: /home/wolverindev/TeaSpeak/Web-Client/shared/loader/loader.ts */
|
||
|
declare interface Window {
|
||
|
tr(message: string): string;
|
||
|
}
|
||
|
declare namespace loader {
|
||
|
export namespace config {
|
||
|
export const loader_groups;
|
||
|
export const verbose;
|
||
|
export const error;
|
||
|
}
|
||
|
export type Task = {
|
||
|
name: string;
|
||
|
priority: number; /* tasks with the same priority will be executed in sync */
|
||
|
function: () => Promise<void>;
|
||
|
};
|
||
|
export enum Stage {
|
||
|
/*
|
||
|
loading loader required files (incl this)
|
||
|
*/
|
||
|
INITIALIZING,
|
||
|
/*
|
||
|
setting up the loading process
|
||
|
*/
|
||
|
SETUP,
|
||
|
/*
|
||
|
loading all style sheet files
|
||
|
*/
|
||
|
STYLE,
|
||
|
/*
|
||
|
loading all javascript files
|
||
|
*/
|
||
|
JAVASCRIPT,
|
||
|
/*
|
||
|
loading all template files
|
||
|
*/
|
||
|
TEMPLATES,
|
||
|
/*
|
||
|
initializing static/global stuff
|
||
|
*/
|
||
|
JAVASCRIPT_INITIALIZING,
|
||
|
/*
|
||
|
finalizing load process
|
||
|
*/
|
||
|
FINALIZING,
|
||
|
/*
|
||
|
invoking main task
|
||
|
*/
|
||
|
LOADED,
|
||
|
DONE
|
||
|
}
|
||
|
export function get_cache_version();
|
||
|
export function finished();
|
||
|
export function running();
|
||
|
export function register_task(stage: Stage, task: Task);
|
||
|
export function execute(): Promise<any>;
|
||
|
export function execute_managed();
|
||
|
export type DependSource = {
|
||
|
url: string;
|
||
|
depends: string[];
|
||
|
};
|
||
|
export type SourcePath = string | DependSource | string[];
|
||
|
export class SyntaxError {
|
||
|
source: any;
|
||
|
constructor(source: any);
|
||
|
}
|
||
|
export function load_script(path: SourcePath): Promise<void>;
|
||
|
export function load_scripts(paths: SourcePath[]): Promise<void>;
|
||
|
export function load_style(path: SourcePath): Promise<void>;
|
||
|
export function load_styles(paths: SourcePath[]): Promise<void>;
|
||
|
export type ErrorHandler = (message: string, detail: string) => void;
|
||
|
export function critical_error(message: string, detail?: string);
|
||
|
export function critical_error_handler(handler?: ErrorHandler, override?: boolean): ErrorHandler;
|
||
|
}
|
||
|
declare let _fadeout_warned;
|
||
|
declare function fadeoutLoader(duration?, minAge?, ignoreAge?);
|
||
|
|
||
|
/* File: /home/wolverindev/TeaSpeak/Web-Client/shared/loader/app.ts */
|
||
|
declare interface Window {
|
||
|
$: JQuery;
|
||
|
}
|
||
|
declare namespace app {
|
||
|
export enum Type {
|
||
|
UNKNOWN,
|
||
|
CLIENT_RELEASE,
|
||
|
CLIENT_DEBUG,
|
||
|
WEB_DEBUG,
|
||
|
WEB_RELEASE
|
||
|
}
|
||
|
export let type: Type;
|
||
|
export function is_web();
|
||
|
export function ui_version();
|
||
|
}
|
||
|
declare const loader_javascript;
|
||
|
declare const loader_webassembly;
|
||
|
declare const loader_style;
|
||
|
declare function load_templates(): Promise<any>;
|