DocSpace-buildtools/packages/login/index.d.ts
2022-09-01 14:57:32 +03:00

141 lines
2.9 KiB
TypeScript

import { Request } from "express";
type WindowI18nType = {
inLoad: object[];
loaded: {
[key: string]: {
data: {
[key: string]: string | undefined;
};
namespaces?: string;
};
};
};
declare global {
interface Window {
authCallback?: (profile: string) => {};
__ASC_INITIAL_LOGIN_STATE__: IInitialState;
initialI18nStoreASC: IInitialI18nStoreASC;
initialLanguage: string;
i18n: WindowI18nType;
[key: string]: object;
}
type MatchType = {
confirmedEmail?: string;
message?: string;
};
type PasswordHashType = {
iterations: number;
salt: string;
size: number;
};
interface IEmailValid {
value: string;
isValid: boolean;
errors: string[]; // TODO: check type
}
interface IPortalSettings {
culture: string;
debugInfo: boolean;
docSpace: boolean;
enableAdmMess: boolean;
enabledJoin: boolean;
greetingSettings: string;
ownerId: string;
passwordHash: PasswordHashType;
personal: boolean;
tenantAlias: string;
tenantStatus: number;
thirdpartyEnable: boolean;
trustedDomainsType: number;
utcHoursOffset: number;
utcOffset: string;
version: string;
}
interface IBuildInfo {
communityServer: string;
documentServer: string;
mailServer: string;
}
interface IProvider {
linked: boolean;
provider: string;
url: string;
}
type ProvidersType = IProvider[];
interface ICapabilities {
ldapEnabled: boolean;
providers: string[];
ssoLabel: string;
ssoUrl: string;
}
interface ITheme {
id: number;
accentColor: string;
buttonsMain: string;
textColor: string;
}
interface IThemes {
limit: number;
selected: number;
themes: ITheme[];
}
interface IInitialState {
portalSettings: IPortalSettings;
buildInfo: IBuildInfo;
providers: ProvidersType;
capabilities: ICapabilities;
match: MatchType;
currentColorScheme: ITheme;
}
interface DevRequest {
assets: assetsType;
}
var IS_DEVELOPMENT: boolean;
var PORT: number;
var IS_PERSONAL: boolean;
var IS_ROOMS_MODE: boolean;
type assetsType = { [key: string]: string } | undefined;
interface IInitialI18nStoreASC extends Object {
en: {
[Common: string]: { [key: any]: string };
[Login: string]: { [key: any]: string };
};
[key: string]: {
[Common: string]: { [key: any]: string };
[Login: string]: { [key: any]: string };
};
}
type HTMLElementEvent<T extends HTMLElement> = Event & {
target: T;
};
type TFuncType = (key: string) => string;
interface IParsedConfig extends Object {
PORT: number;
}
interface ILoginRequest extends Request {
i18n?: I18next;
t?: TFuncType;
}
type timeoutType = ReturnType<typeof setTimeout>;
interface IAcceptLanguage {
code?: string;
quality?: number;
}
}