UNPKG

@converse/headless

Version:

Converse.js Headless build

237 lines 15.1 kB
export default RosterContact; declare const RosterContact_base: { new (...args: any[]): { [x: string]: any; _vcard: import("../vcard/vcard.js").default; lazy_load_vcard: boolean; initialize(): void; readonly vcard: import("../vcard/vcard.js").default; getVCard(): Promise<import("../vcard/vcard.js").default | null>; "__#4@#private": any; _storage?: import("@converse/skeletor").PersistentStorage; _changing: boolean; _pending: boolean | import("@converse/skeletor").ModelOptions; _previousAttributes?: import("@converse/skeletor").ModelAttributes; _url: string; _urlRoot: string; attrs: import("@converse/skeletor").ModelAttributes; attributes: import("@converse/skeletor").ModelAttributes; changed: Partial<import("@converse/skeletor").ModelAttributes>; cid: string; collection?: import("@converse/skeletor").Collection; id: string | number; hydrated?: Promise<void>; validationError: string | number | null; storage: import("@converse/skeletor").PersistentStorage; browserStorage: import("@converse/skeletor").PersistentStorage; readonly autoSync: boolean; readonly autoSyncDelay: number; readonly idAttribute: string; readonly cidPrefix: string; preinitialize(...args: any[]): void; validate(attrs: import("@converse/skeletor").ObjectWithId | Partial<import("@converse/skeletor").ModelAttributes>, options?: import("@converse/skeletor").ModelOptions): string | number | null | void; defaults(): Partial<import("@converse/skeletor").ModelAttributes>; readonly computed: import("@converse/skeletor").ComputedProperties<any>; toJSON(): import("@converse/skeletor").ModelAttributes; sync(method: import("@converse/skeletor").SyncOperation, model: Model<any>, options: import("@converse/skeletor").Options): any; get<K extends string | number>(attr: K): import("@converse/skeletor").ModelAttributes[K]; keys(): string[]; values(): any[]; pairs(): [string | number, any][]; entries(): [string | number, any][]; invert(): Record<string, string | number>; pick<K extends string | number>(...args: K[]): Pick<import("@converse/skeletor").ModelAttributes, K>; omit<K extends string | number>(...args: K[]): Omit<import("@converse/skeletor").ModelAttributes, K>; isEmpty(): boolean; has(attr: string | number): boolean; matches(attrs: Partial<import("@converse/skeletor").ModelAttributes>): boolean; set(key: string | import("@converse/skeletor").ObjectWithId | Partial<import("@converse/skeletor").ModelAttributes>, val?: any, options?: import("@converse/skeletor").ModelOptions): any; unset(attr: string | number, options?: import("@converse/skeletor").ModelOptions): any; clear(options?: import("@converse/skeletor").ModelOptions): any; hasChanged(attr?: string | number): boolean; changedAttributes(diff?: Partial<import("@converse/skeletor").ModelAttributes>): false | Partial<import("@converse/skeletor").ModelAttributes>; previous<K extends string | number>(attr: K): import("@converse/skeletor").ModelAttributes[K]; previousAttributes(): import("@converse/skeletor").ModelAttributes; fetch(options?: import("@converse/skeletor").Options): any; save(key?: string | Partial<import("@converse/skeletor").ModelAttributes>, val?: any, options?: import("@converse/skeletor").ModelOptions): any; destroy(options?: import("@converse/skeletor").ModelOptions): any; urlRoot: string; url: string; parse(resp: any, options?: import("@converse/skeletor").ModelOptions): void | Partial<import("@converse/skeletor").ModelAttributes>; isNew(): boolean; isValid(options?: import("@converse/skeletor").ModelOptions): boolean; subscribe(event: string, callback: import("@converse/skeletor").EventCallback, context?: unknown): () => void; subscribe(callback: (model: any, changed: Partial<import("@converse/skeletor").ModelAttributes>) => void): () => void; _validate(attrs: import("@converse/skeletor").ObjectWithId | Partial<import("@converse/skeletor").ModelAttributes>, options?: import("@converse/skeletor").ModelOptions): boolean; _events?: import("@converse/skeletor").EventHandlersMap; _listeners?: import("@converse/skeletor").EventListenerMap; _listeningTo?: import("@converse/skeletor").EventListenerMap; _listenId?: string; on(name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback | import("@converse/skeletor").EventContext, context?: import("@converse/skeletor").EventContext): any; listenTo(obj: import("@converse/skeletor").ObjectListenedTo, name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback): any; off(name?: string | import("@converse/skeletor").EventCallbackMap | null, callback?: import("@converse/skeletor").EventCallback | import("@converse/skeletor").EventContext | null, context?: import("@converse/skeletor").EventContext): any; stopListening(obj?: any, name?: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback): any; once(name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback | import("@converse/skeletor").EventContext, context?: import("@converse/skeletor").EventContext): any; listenToOnce(obj: any, name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback): any; trigger(name: string, ...args: any[]): any; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: PropertyKey): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: PropertyKey): boolean; }; } & { new (...args: any[]): { [x: string]: any; setColor(): Promise<void>; getIdentifier(): any; getColor(): Promise<string>; getAvatarStyle(append_style?: string): Promise<string>; "__#4@#private": any; _storage?: import("@converse/skeletor").PersistentStorage; _changing: boolean; _pending: boolean | import("@converse/skeletor").ModelOptions; _previousAttributes?: import("@converse/skeletor").ModelAttributes; _url: string; _urlRoot: string; attrs: import("@converse/skeletor").ModelAttributes; attributes: import("@converse/skeletor").ModelAttributes; changed: Partial<import("@converse/skeletor").ModelAttributes>; cid: string; collection?: import("@converse/skeletor").Collection; id: string | number; hydrated?: Promise<void>; validationError: string | number | null; storage: import("@converse/skeletor").PersistentStorage; browserStorage: import("@converse/skeletor").PersistentStorage; readonly autoSync: boolean; readonly autoSyncDelay: number; readonly idAttribute: string; readonly cidPrefix: string; preinitialize(...args: any[]): void; initialize(attrs?: Partial<import("@converse/skeletor").ModelAttributes>, options?: import("@converse/skeletor").ModelOptions): void; validate(attrs: import("@converse/skeletor").ObjectWithId | Partial<import("@converse/skeletor").ModelAttributes>, options?: import("@converse/skeletor").ModelOptions): string | number | null | void; defaults(): Partial<import("@converse/skeletor").ModelAttributes>; readonly computed: import("@converse/skeletor").ComputedProperties<any>; toJSON(): import("@converse/skeletor").ModelAttributes; sync(method: import("@converse/skeletor").SyncOperation, model: Model<any>, options: import("@converse/skeletor").Options): any; get<K extends string | number>(attr: K): import("@converse/skeletor").ModelAttributes[K]; keys(): string[]; values(): any[]; pairs(): [string | number, any][]; entries(): [string | number, any][]; invert(): Record<string, string | number>; pick<K extends string | number>(...args: K[]): Pick<import("@converse/skeletor").ModelAttributes, K>; omit<K extends string | number>(...args: K[]): Omit<import("@converse/skeletor").ModelAttributes, K>; isEmpty(): boolean; has(attr: string | number): boolean; matches(attrs: Partial<import("@converse/skeletor").ModelAttributes>): boolean; set(key: string | import("@converse/skeletor").ObjectWithId | Partial<import("@converse/skeletor").ModelAttributes>, val?: any, options?: import("@converse/skeletor").ModelOptions): any; unset(attr: string | number, options?: import("@converse/skeletor").ModelOptions): any; clear(options?: import("@converse/skeletor").ModelOptions): any; hasChanged(attr?: string | number): boolean; changedAttributes(diff?: Partial<import("@converse/skeletor").ModelAttributes>): false | Partial<import("@converse/skeletor").ModelAttributes>; previous<K extends string | number>(attr: K): import("@converse/skeletor").ModelAttributes[K]; previousAttributes(): import("@converse/skeletor").ModelAttributes; fetch(options?: import("@converse/skeletor").Options): any; save(key?: string | Partial<import("@converse/skeletor").ModelAttributes>, val?: any, options?: import("@converse/skeletor").ModelOptions): any; destroy(options?: import("@converse/skeletor").ModelOptions): any; urlRoot: string; url: string; parse(resp: any, options?: import("@converse/skeletor").ModelOptions): void | Partial<import("@converse/skeletor").ModelAttributes>; isNew(): boolean; isValid(options?: import("@converse/skeletor").ModelOptions): boolean; subscribe(event: string, callback: import("@converse/skeletor").EventCallback, context?: unknown): () => void; subscribe(callback: (model: any, changed: Partial<import("@converse/skeletor").ModelAttributes>) => void): () => void; _validate(attrs: import("@converse/skeletor").ObjectWithId | Partial<import("@converse/skeletor").ModelAttributes>, options?: import("@converse/skeletor").ModelOptions): boolean; _events?: import("@converse/skeletor").EventHandlersMap; _listeners?: import("@converse/skeletor").EventListenerMap; _listeningTo?: import("@converse/skeletor").EventListenerMap; _listenId?: string; on(name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback | import("@converse/skeletor").EventContext, context?: import("@converse/skeletor").EventContext): any; listenTo(obj: import("@converse/skeletor").ObjectListenedTo, name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback): any; off(name?: string | import("@converse/skeletor").EventCallbackMap | null, callback?: import("@converse/skeletor").EventCallback | import("@converse/skeletor").EventContext | null, context?: import("@converse/skeletor").EventContext): any; stopListening(obj?: any, name?: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback): any; once(name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback | import("@converse/skeletor").EventContext, context?: import("@converse/skeletor").EventContext): any; listenToOnce(obj: any, name: string | import("@converse/skeletor").EventCallbackMap, callback?: import("@converse/skeletor").EventCallback): any; trigger(name: string, ...args: any[]): any; constructor: Function; toString(): string; toLocaleString(): string; valueOf(): Object; hasOwnProperty(v: PropertyKey): boolean; isPrototypeOf(v: Object): boolean; propertyIsEnumerable(v: PropertyKey): boolean; }; } & typeof Model; declare class RosterContact extends RosterContact_base { constructor(attributes?: Partial<import("@converse/skeletor").ModelAttributes>, options?: import("@converse/skeletor").ModelOptions); defaults(): { groups: any[]; num_unread: number; }; initialize(attrs: any): void; initialized: Promise<void>; setup(attrs: any): Promise<void>; setPresence(): Promise<void>; presence: any; getStatus(): any; openChat(): Promise<any>; /** * @param {import('./types').ContactDisplayNameOptions} [options] * @returns {string} */ getDisplayName(options?: import("./types").ContactDisplayNameOptions): string; /** * Send a presence subscription request to this roster contact * @param {string} [message] - An optional message to explain the * reason for the subscription request. */ subscribeToPresence(message?: string): this; /** * Upon receiving the presence stanza of type "subscribed", * the user SHOULD acknowledge receipt of that subscription * state notification by sending a presence stanza of type * "subscribe" to the contact */ ackSubscribe(): void; /** * Upon receiving the presence stanza of type "unsubscribed", * the user SHOULD acknowledge receipt of that subscription state * notification by sending a presence stanza of type "unsubscribe" * this step lets the user's server know that it MUST no longer * send notification of the subscription state change to the user. */ ackUnsubscribe(): void; /** * Unauthorize this contact's presence subscription * @param {string} [message] - Optional message to send to the person being unauthorized */ unauthorize(message?: string): this; /** * Authorize presence subscription * @param {string} [message] - Optional message to send to the person being authorized */ authorize(message?: string): this; /** * Remove this contact from the roster * @param {boolean} [unauthorize] - Whether to also unauthorize the * @returns {Promise<Error|Element>} */ remove(unauthorize?: boolean): Promise<Error | Element>; /** * @param {import('./types').RosterContactUpdateAttrs} attrs * @returns {Promise} */ update(attrs: import("./types").RosterContactUpdateAttrs): Promise<any>; /** * Instruct the XMPP server to remove this contact from our roster * @returns {Promise} */ sendRosterRemoveStanza(): Promise<any>; isUnsaved(): boolean; } import { Model } from '@converse/skeletor'; //# sourceMappingURL=contact.d.ts.map