/** Low-level API client-to-server ActivityPub methods */ export class Activities { static JSONLDMime: string; static PublicAddress: string; static NodeInfoV21: string; static NodeInfoV20: string; /** * @param {Activities.APActor} actor The user's actor object * @param {string} homeImmer Protocol and domain of user's home Immers server * @param {Activities.APObject} place Place-type object representing this Immersive Web experience * @param {string} [token] OAuth2 token for user's home Immers server * @param {string} [localImmer] Origin of local Immers server, e.g. https://immers.space */ constructor(actor: Activities.APActor, homeImmer: string, place: Activities.APObject, token?: string, localImmer?: string); actor: Activities.APActor; homeImmer: string; place: Activities.APObject; localImmer: any; nextInboxPage: any; nextOutboxPage: any; inboxStartDate: Date; outboxStartDate: Date; trustedIRI(IRI: any): any; /** * Fetch the ActivityPub entity at the given IRI * (may be object, activity, collection, et c). * If the domain is the user's home immer or the local immer, * makes a fetch with credentials included. Otherwise uses the user's * home immer proxy service, if available * @param {string} IRI * @returns {Promise} */ getObject(IRI: string): Promise; postActivity(activity: any): Promise; /** * Post an activity with media upload * @param {Activities.APActivity} activity * @param {Blob} file * @param {Blob} [icon] */ postMedia(activity: Activities.APActivity, file: Blob, icon?: Blob): Promise; inbox(): Promise; outbox(): Promise; /** * List of IRIs for users blocked by this user * @returns {string[]} blocked user IRIs */ blockList(): string[]; accept(follow: any): Promise; /** * Add something to a user collection. The object of this must be an activity, * use e.g. the Create actvitiy for a Model object to add it to the 'avatars' collection * @param {(Activities.IRI|Activities.APObject)} activity - id or object of the activity to be added * @param {(Activities.IRI|string)} target - Collection identifier from actor.streams, or collection name to be converted into an identifier */ add(activity: (Activities.IRI | Activities.APObject), target: (Activities.IRI | string)): Promise; arrive(place?: Activities.APObject): Promise; leave(place?: Activities.APObject): Promise; block(blockeeId: any): Promise; /** * Post a create activity for an object * @param {Activities.APObject} object - New object to be wrapped in Create activity * @param {Activities.IRI[]} to - direct addressee IRIs * @param {Activities.Audience} audience - direct, friends, or public * @param {string} [summary] - activity summary description (may contain HTML) * @return {Promise} The resulting Create activity IRI */ create(object: Activities.APObject, to: Activities.IRI[], audience: Activities.Audience, summary?: string): Promise; delete(object: any): Promise; follow(targetId: any): Promise; friends(): Promise; image(urlOrBlob: any, to: any, audience: any, summary: any): Promise; note(content: any, to: any, audience: any, summary: any): Promise; model(name: any, glb: any, icon: any, to: any, audience: any): Promise; reject(objectId: any, recipientId: any): Promise; remove(activity: any, target: any): Promise; undo(activity: any): Promise; updateProfile(update: any): Promise; video(urlOrBlob: any, to: any, audience: any, summary: any): Promise; #private; } export namespace Activities { /** * String representing a unique resource URL */ type IRI = string; /** * visibilty and delivery targets for activity or obejct */ type Audience = ('direct' | 'friends' | 'public'); /** * Object representing an ActivityPub object */ type APObject = { id: Activities.IRI; type: string; }; /** * Object representing an ActivityPub object */ type APLink = { id: Activities.IRI; type: string; }; /** * Object representing an ActivityPub activity */ type APActivity = { id: Activities.IRI; type: string; actor: Activities.APActor; }; /** * Object representing an ActivityPub actor */ type APActor = { id: Activities.IRI; type: string; inbox: Activities.IRI; outbox: Activities.IRI; }; type APPlace = { id: Activities.IRI; type: 'Place'; /** * Title of the destination */ name: string; /** * Description destination */ summary?: string; /** * link to visit the destination */ url: string; /** * who can view this object (generally Activities.PublicAddress) */ audience: string; /** * preview image */ icon?: (string | Activities.APObject | Activities.APLink); /** * Main Place object representing the immer this place exists in */ context?: Activities.APPlace; }; type APModel = { id: Activities.IRI; type: 'Model'; /** * Model name */ name: string; /** * link to 3D model file */ url: (string | Activities.APObject | Activities.APLink); /** * preview image */ icon?: (string | Activities.APObject | Activities.APLink); /** * who can view this object (generally Activities.PublicAddress) */ audience: string; }; }