import { WeavyOptions, Destructable, WeavyClientOptionsType, WeavyTokenFactory, StrictWeavyOptions, Resettable } from '../types/weavy.types'; import { WeavyAuthenticationProps } from './authentication'; import { WeavyConnectionProps } from './connection'; import { WeavyFetchProps } from './fetch'; import { WeavyLocalizationProps } from './localization'; import { WeavyNetworkProps } from './network'; import { WeavyQueryProps } from './query'; import { WeavySettingsProps } from './settings'; import { WeavyStylesProps } from './styles'; import { WeavyVersionProps } from './version'; import { WeavyContextProviderProps } from './context'; import { WeavyComponentSettingProps } from '../types/component.types'; import { WeavyLinksProps } from './links'; export type { WeavyOptions, Destructable, WeavyClientOptionsType, WeavyTokenFactory, StrictWeavyOptions }; export type * from './authentication'; export type * from './connection'; export type * from './fetch'; export type * from './localization'; export type * from './network'; export type * from './query'; export type * from './settings'; export type * from './styles'; export type * from './version'; /** * Context for Weavy that handles communication with the server, data handling and common options. * Requires a `url` to the Weavy environment and an async `tokenFactory` that provides user access tokens. */ export type WeavyType = WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps; /** * Context for Weavy that handles communication with the server, data handling and common options. * Requires a `url` to the Weavy environment and an async `tokenFactory` that provides user access tokens. * * @fires wy-notifications {WyNotificationsEventType} */ export declare class WeavyClient implements WeavyOptions, Resettable, Destructable { /** * The semver version of the package. */ static readonly version: string; /** * The Weavy source name; package name. */ static readonly sourceName: string; /** * The Weavy source format; file format. */ static readonly sourceFormat: string; static defaults: StrictWeavyOptions & WeavyComponentSettingProps; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; constructor(options?: WeavyClientOptionsType); reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; } declare const Weavy_base: { new (...args: any[]): { _hostContextProvider?: import('../utils/context-provider').WyContextProvider; updateContext(): void; destroy(): void; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; }; } & { new (...args: any[]): { _locales: Map | (() => Promise)>; get locales(): WeavyLocalizationProps["locales"]; set locales(locales: WeavyLocalizationProps["locales"] | null | undefined); _locale: string; _localization?: ReturnType; get localization(): { getLocale: (() => string) & { _LIT_LOCALIZE_GET_LOCALE_?: never; }; setLocale: ((newLocale: string) => Promise) & { _LIT_LOCALIZE_SET_LOCALE_?: never; }; } | undefined; get locale(): string; set locale(newLocale: string | null | undefined); loadLocale(newLocale: string): Promise; configureLocalization(): void; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; get sourceLocale(): "" | "en"; } & { new (...args: any[]): { _resolveConnectionRequested?: ((value: unknown) => void) | undefined; _whenConnectionRequested: Promise; whenConnectionRequested(): Promise; _resolveConnectionCreated?: ((value: import('../../@microsoft/signalr/dist/browser/signalr.min.js').HubConnection) => void) | undefined; _whenConnectionCreated: Promise; whenConnectionCreated(): Promise; _connection?: import('../../@microsoft/signalr/dist/browser/signalr.min.js').HubConnection; _connectionEventListeners: { name: string; callback: (realtimeEvent: never) => void; }[]; signalRAccessTokenRefresh: boolean; _whenConnectionStartedResolve?: ((value: import('../../@microsoft/signalr/dist/browser/signalr.min.js').HubConnection) => void) | undefined; _whenConnectionStartedReject?: ((reason: unknown) => void) | undefined; _whenConnectionStarted: Promise; get rtmConnection(): import('../../@microsoft/signalr/dist/browser/signalr.min.js').HubConnection | undefined; whenConnectionStarted(): Promise; createConnection(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps): Promise; disconnect(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps): Promise; _resubscribeAll(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps): Promise; connect(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps): Promise; subscribe(group: string | null, event: string, callback: (realtimeEvent: T) => void, silent?: boolean): Promise; unsubscribe(group: string | null, event: string, callback: (realTimeEvent: T) => void, silent?: boolean): Promise; destroy(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps): void; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; }; } & { new (...args: any[]): { _configurationState: import('../types/server.types').ConfigurationState; _configurationTimer?: number | null; _networkEvents: Set<(status: import('../types/server.types').NetworkStatus) => void>; _connectionState: import('../types/server.types').ConnectionState; _serverState: import('../types/server.types').ServerState; _networkState: import('../types/server.types').NetworkState; _networkStateIsPending: boolean; get configurationState(): import('../types/server.types').ConfigurationState; set configurationState(state: import('../types/server.types').ConfigurationState); get networkState(): import('../types/server.types').NetworkState; set networkState(state: import('../types/server.types').NetworkState); get serverState(): import('../types/server.types').ServerState; set serverState(state: import('../types/server.types').ServerState); get connectionState(): import('../types/server.types').ConnectionState; set connectionState(state: import('../types/server.types').ConnectionState); get networkStateIsPending(): boolean; set networkStateIsPending(isPending: boolean); get network(): import('../types/server.types').NetworkStatus; requestConfigurationCheck(): void; triggerNetworkChange(): void; addNetworkListener(callback: (state: import('../types/server.types').NetworkStatus) => void): void; removeNetworkListener(callback: (state: import('../types/server.types').NetworkStatus) => void): void; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & { new (...args: any[]): { _resolveTokenFactory?: ((value: unknown) => void) | undefined; _whenTokenFactory: Promise; whenTokenFactory(): Promise; _resolveUrlAndTokenFactory?: ((value: unknown) => void) | undefined; _whenUrlAndTokenFactory: Promise; whenUrlAndTokenFactory(): Promise; _resolveTokenIsValid?: ((value: unknown) => void) | undefined; _whenTokenIsValid: Promise; whenTokenIsValid(): Promise; _tokenFactory?: WeavyTokenFactory; get tokenFactory(): WeavyTokenFactory | undefined; set tokenFactory(tokenFactory: WeavyTokenFactory | null | undefined); _tokenUrl?: URL; get tokenUrl(): URL | undefined; set tokenUrl(tokenUrl: string | URL | null | undefined); _tokenPromise: Promise | null; _token: string; _validateToken(token: unknown): boolean; _validTokenFromFactory: (refresh: boolean) => Promise; getToken(refresh?: boolean): Promise; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & { new (...args: any[]): { _hostIsConnectedObserver?: ResizeObserver; _queryClient: import('@tanstack/query-core').QueryClient; _unsubscribeQueryClient?: (() => void) | undefined; _sessionStoragePersister?: import('@tanstack/query-persist-client-core').Persister; get queryClient(): import('@tanstack/query-core').QueryClient; initQueryClient(): Promise; reset(): Promise; disconnectQueryClient(): Promise; destroy(): void; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; _isDestroyed: boolean; get isDestroyed(): boolean; }; } & { new (...args: any[]): { readonly version: string; _whenCheckVersion?: Promise; checkVersion(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps): Promise; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & { new (...args: any[]): { fetchOptions(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps, options?: import('../types/http.types').FetchOptions, authorized?: boolean): Promise; fetch(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps, url: string | URL, options?: import('../types/http.types').FetchOptions, retry?: boolean): Promise; fetchFile(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps, url: string | URL, options?: import('../types/http.types').FetchOptions, retry?: boolean): Promise; upload(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps, url: string | URL, method: import('../types/http.types').HttpUploadMethodType, body: string | FormData, contentType?: import('../types/http.types').HeaderContentType, onProgress?: ((progress: number) => void) | undefined, signal?: AbortSignal, retry?: boolean): Promise; get(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps, url: string | URL): Promise; post(this: /*elided*/ any & WeavyClient & StrictWeavyOptions & WeavySettingsProps & WeavyNetworkProps & WeavyAuthenticationProps & WeavyLocalizationProps & WeavyConnectionProps & WeavyQueryProps & WeavyVersionProps & WeavyFetchProps & WeavyStylesProps & WeavyContextProviderProps & WeavyLinksProps, url: string | URL, method: import('../types/http.types').HttpMethodType, body?: BodyInit, contentType?: import('../types/http.types').HeaderContentType): Promise; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & { new (...args: any[]): { readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & { new (...args: any[]): { _annotations?: WeavySettingsProps["annotations"]; get annotations(): import('../types/msg.types').AnnotationsAppearanceType; set annotations(annotations: import('../types/msg.types').AnnotationsAppearanceType); _enterToSend?: WeavySettingsProps["enterToSend"]; get enterToSend(): import('../types/editor.types').EnterToSend; set enterToSend(enterToSend: import('../types/editor.types').EnterToSend); _reactions?: WeavySettingsProps["reactions"]; get reactions(): string; set reactions(reactions: string); readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & { new (...args: any[]): { storage: Storage | undefined; setLink(link: import('..').LinkType): boolean; provideStorageLink(link: import('..').LinkType): void; readStorageLink(): import('..').LinkType | undefined; consumeStorageLink(): void; readonly weavySid: string; readonly weavyId: string; /** * The host where the Weavy context is provided. */ readonly host: HTMLElement; cloudFilePickerUrl: string | URL; configurationTimeout: number; disableEnvironmentImports: boolean; gcTime: number; scrollBehavior: "auto" | "instant" | "smooth"; staleTime: number; tokenFactoryRetryDelay: number; tokenFactoryTimeout: number; _resolveUrl?: (url: URL) => void; _whenUrl: Promise; whenUrl(): Promise; _url?: URL; /** * The URL to the weavy environment. */ get url(): URL | undefined; set url(url: string | URL | null | undefined); /** * Prefix to use for caches. */ get cachePrefix(): string; reset(): Promise; _isDestroyed: boolean; get isDestroyed(): boolean; destroy(): void; }; } & typeof WeavyClient; /** * Context for Weavy that handles communication with the server, data handling and common options. * Requires a `url` to the Weavy environment and an async `tokenFactory` that provides user access tokens. * * @fires wy-notifications {WyNotificationsEventType} */ export declare class Weavy extends Weavy_base implements WeavyType { } //# sourceMappingURL=weavy.d.ts.map