/** * (c) Copyright Ascensio System SIA 2026 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * @license */ /** * @module * @mergeModuleWith */ import type { TFrameConfig } from "../types"; /** * The ONLYOFFICE Apps CSP validation endpoint. Used internally to check * whether the current host domain is allowed in the target ONLYOFFICE Apps instance. * * @see {@link TFrameConfig.checkCSP} — enables/disables CSP validation on frame init. */ export declare const CSPApiUrl: "/api/2.0/security/csp"; /** * The prefix for iframe `name` attribute. The full name is `{FRAME_NAME}__#{frameId}`. * Used internally by the postMessage protocol to route messages to the correct frame. * * @see {@link TFrameConfig.frameId} — the unique identifier appended to this prefix. */ export declare const FRAME_NAME: "frameDocSpace"; /** * The default configuration applied to every frame before user overrides. * Merge order in {@link SDKInstance.initFrame}: `defaultConfig` → instance config → user config. * * Override only the fields you need — unset fields fall back to these defaults. * * @example * ```typescript * // Minimal config — everything else comes from defaultConfig * sdk.init({ * frameId: "ds-frame", * src: "https://portal.example.com", * mode: "manager", * }); * ``` */ export declare const defaultConfig: TFrameConfig; /** * Error message shown when the host domain is not in the ONLYOFFICE Apps CSP allowlist. * Displayed inside the iframe via `srcdoc` when {@link TFrameConfig.checkCSP} is `true` and validation fails. */ export declare const cspErrorText: "The current domain is not set in the Content Security Policy (CSP) settings."; /** * Error message passed to {@link TFrameEvents.onAppError} when a method is called * before the postMessage channel is established (i.e. before the first valid message from the iframe). */ export declare const connectErrorText: "Message bus is not connected with frame"; /** * Reply the ONLYOFFICE Apps portal sends as `methodReturnData` when the current mode has no handler * for the called method. `SDKInstance.#handleMethodResponse` rejects it with {@link SDKErrorCode.ModeMismatch}. * @internal */ export declare const wrongMethodText: "Wrong method for this mode"; /** * How long before an OAuth access token expires the SDK asks {@link TFrameConfig.getToken} for a * fresh one and pushes it into the frame (proactive refresh), in milliseconds. * @internal */ /** * Longest delay `setTimeout` accepts (2^31 - 1 ms); longer waits are split into slices. * @internal */ export declare const MAX_TIMER_DELAY_MS = 2147483647; export declare const TOKEN_REFRESH_LEAD_MS: 60000;