DocSpace-client/packages/login/index.d.ts

181 lines
3.5 KiB
TypeScript
Raw Normal View History

2022-08-04 09:14:55 +00:00
import { Request } from "express";
type WindowI18nType = {
inLoad: object[];
loaded: {
[key: string]: {
data: {
[key: string]: string | undefined;
};
namespaces?: string;
};
};
};
2022-08-04 09:14:55 +00:00
declare global {
interface Window {
authCallback?: (profile: string) => {};
2022-08-11 08:30:43 +00:00
__ASC_INITIAL_LOGIN_STATE__: IInitialState;
initialI18nStoreASC: IInitialI18nStoreASC;
2022-08-11 08:30:43 +00:00
initialLanguage: string;
i18n: WindowI18nType;
2022-08-12 19:34:47 +00:00
[key: string]: object;
2022-08-04 09:14:55 +00:00
}
type MatchType = {
confirmedEmail?: string;
2022-09-01 11:57:32 +00:00
message?: string;
messageKey?: string;
authError?: string;
};
2022-08-17 07:24:19 +00:00
type PasswordHashType = {
iterations: number;
salt: string;
size: number;
};
interface IEmailValid {
value: string;
isValid: boolean;
errors: string[]; // TODO: check type
}
interface IPortalSettings {
2022-08-08 15:36:05 +00:00
culture: string;
debugInfo: boolean;
docSpace: boolean;
enableAdmMess: boolean;
enabledJoin: boolean;
greetingSettings: string;
ownerId: string;
2022-08-17 07:24:19 +00:00
passwordHash: PasswordHashType;
2022-08-08 15:36:05 +00:00
personal: boolean;
tenantAlias: string;
tenantStatus: number;
thirdpartyEnable: boolean;
trustedDomainsType: number;
utcHoursOffset: number;
utcOffset: string;
version: string;
standalone: boolean;
2023-03-23 11:47:28 +00:00
trustedDomains: string[];
2022-08-08 15:36:05 +00:00
}
2022-08-12 19:34:47 +00:00
interface IBuildInfo {
2022-08-08 15:36:05 +00:00
communityServer: string;
documentServer: string;
mailServer: string;
}
2022-08-12 19:34:47 +00:00
interface IProvider {
2022-08-08 15:36:05 +00:00
linked: boolean;
provider: string;
url: string;
}
2023-03-24 10:19:31 +00:00
type ProvidersType = IProvider[] | undefined;
2022-08-08 15:36:05 +00:00
2022-08-12 19:34:47 +00:00
interface ICapabilities {
2022-08-08 15:36:05 +00:00
ldapEnabled: boolean;
providers: string[];
ssoLabel: string;
ssoUrl: string;
}
2022-08-31 14:32:33 +00:00
2023-03-17 12:18:50 +00:00
type TThemeObj = {
accent: string;
buttons: string;
}
2022-08-31 14:32:33 +00:00
interface ITheme {
id: number;
2023-03-17 12:18:50 +00:00
main: TThemeObj;
text: TThemeObj;
name: string;
2022-08-31 14:32:33 +00:00
}
interface IThemes {
limit: number;
selected: number;
themes: ITheme[];
}
interface IError {
status: number;
standalone: boolean;
2023-02-07 15:36:16 +00:00
message: string | undefined;
}
2022-08-08 15:36:05 +00:00
interface IInitialState {
portalSettings?: IPortalSettings;
buildInfo?: IBuildInfo;
providers?: ProvidersType;
capabilities?: ICapabilities;
match?: MatchType;
currentColorScheme?: ITheme;
isAuth?: boolean;
2023-03-24 10:19:31 +00:00
logoUrls: ILogoUrl[];
error?: IError;
2022-08-04 09:14:55 +00:00
}
interface DevRequest {
assets: assetsType;
2022-08-04 09:14:55 +00:00
}
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 };
};
}
2022-08-25 15:13:46 +00:00
type HTMLElementEvent<T extends HTMLElement> = Event & {
target: T;
};
2022-08-26 13:38:32 +00:00
type TFuncType = (key: string) => string;
2022-08-26 22:52:57 +00:00
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;
}
2023-03-24 10:19:31 +00:00
interface IUserTheme {
[key: string]: string;
isBase: boolean;
}
type TLogoPath = {
light: string;
dark?: string;
}
type TLogoSize = {
width: number;
height: number;
isEmpty: boolean;
}
interface ILogoUrl {
name: string;
path: TLogoPath;
size: TLogoSize;
}
}