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

200 lines
5.0 KiB
TypeScript
Raw Normal View History

2024-03-21 14:09:55 +00:00
// (c) Copyright Ascensio System SIA 2009-2024
//
2024-03-17 23:13:02 +00:00
// This program is a free software product.
// You can redistribute it and/or modify it under the terms
// of the GNU Affero General Public License (AGPL) version 3 as published by the Free Software
// Foundation. In accordance with Section 7(a) of the GNU AGPL its Section 15 shall be amended
// to the effect that Ascensio System SIA expressly excludes the warranty of non-infringement of
// any third-party rights.
2024-03-21 14:09:55 +00:00
//
2024-03-17 23:13:02 +00:00
// This program is distributed WITHOUT ANY WARRANTY, without even the implied warranty
// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. For details, see
// the GNU AGPL at: http://www.gnu.org/licenses/agpl-3.0.html
2024-03-21 14:09:55 +00:00
//
2024-03-17 23:13:02 +00:00
// You can contact Ascensio System SIA at Lubanas st. 125a-25, Riga, Latvia, EU, LV-1021.
2024-03-21 14:09:55 +00:00
//
2024-03-17 23:13:02 +00:00
// The interactive user interfaces in modified source and object code versions of the Program must
// display Appropriate Legal Notices, as required under Section 5 of the GNU AGPL version 3.
2024-03-21 14:09:55 +00:00
//
2024-03-17 23:13:02 +00:00
// Pursuant to Section 7(b) of the License you must retain the original Product logo when
// distributing the program. Pursuant to Section 7(e) we decline to grant you any rights under
// trademark law for use of our trademarks.
2024-03-21 14:09:55 +00:00
//
2024-03-17 23:13:02 +00:00
// All the Product's GUI elements, including illustrations and icon sets, as well as technical writing
// content are licensed under the terms of the Creative Commons Attribution-ShareAlike 4.0
// International. See the License terms at http://creativecommons.org/licenses/by-sa/4.0/legalcode
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;
};
2023-08-31 12:39:57 +00:00
type CaptchaPublicKeyType = string | undefined;
2022-08-17 07:24:19 +00:00
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[];
2023-08-31 12:39:57 +00:00
recaptchaPublicKey: CaptchaPublicKeyType;
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;
2023-08-31 12:39:57 +00:00
};
2023-03-17 12:18:50 +00:00
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;
}
2023-09-13 10:08:44 +00:00
interface ISSOSettings {
hideAuthPage: boolean;
}
2022-08-08 15:36:05 +00:00
interface IInitialState {
portalSettings?: IPortalSettings;
buildInfo?: IBuildInfo;
providers?: ProvidersType;
capabilities?: ICapabilities;
match?: MatchType;
currentColorScheme?: ITheme;
2023-09-13 10:08:44 +00:00
ssoSettings?: ISSOSettings;
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;
var BROWSER_DETECTOR_URL: string;
var CONFIG_URL: string;
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;
}
2023-08-31 12:39:57 +00:00
}