1
0
mirror of https://github.com/hrfee/jfa-go.git synced 2024-09-20 03:10:11 +00:00
jfa-go/ts/typings/d.ts
Harvey Tindall 2d443fb50b
fully functional invites tab, flesh out bugs
also:
* fix select chevrons appearing above modals
* add custom errors and use them for http errors, also now appear above
  modals.
* functional logout button
* slightly cleaned up admin.ts
2020-12-30 23:48:01 +00:00

82 lines
1.7 KiB
TypeScript

declare interface Modal {
modal: HTMLElement;
closeButton: HTMLSpanElement
show: () => void;
close: (event?: Event) => void;
toggle: () => void;
}
interface ArrayConstructor {
from(arrayLike: any, mapFn?, thisArg?): Array<any>;
}
declare interface Window {
URLBase: string;
modals: Modals;
cssFile: string;
availableProfiles: string[];
jfUsers: Array<Object>;
notifications_enabled: boolean;
token: string;
buttonWidth: number;
transitionEvent: string;
animationEvent: string;
tabs: Tabs;
invites: inviteList;
notifications: NotificationBox;
}
declare interface NotificationBox {
connectionError: () => void;
customError: (type: string, message: string) => void;
}
declare interface Tabs {
tabs: Array<Tab>;
addTab: (tabID: string, preFunc?: () => void, postFunc?: () => void) => void;
switch: (tabID: string) => void;
}
declare interface Tab {
tabID: string;
tabEl: HTMLDivElement;
buttonEl: HTMLSpanElement;
preFunc?: () => void;
postFunc?: () => void;
}
declare interface Modals {
about: Modal;
login: Modal;
addUser: Modal;
modifyUser: Modal;
deleteUser: Modal;
settingsRestart: Modal;
settingsRefresh: Modal;
ombiDefaults?: Modal;
newAccountSuccess?: Modal;
}
interface Invite {
code?: string;
expiresIn?: string;
remainingUses?: string;
email?: string;
usedBy?: string[][];
created?: string;
notifyExpiry?: boolean;
notifyCreation?: boolean;
profile?: string;
}
interface inviteList {
empty: boolean;
invites: { [code: string]: Invite }
add: (invite: Invite) => void;
reload: () => void;
}
declare var config: Object;
declare var modifiedConfig: Object;