@veltdev/types
Version:
Velt is an SDK to add collaborative features to your product within minutes. Example: Comments like Figma, Frame.io, Google docs or sheets, Recording like Loom, Huddles like Slack and much more.
93 lines (92 loc) • 2.48 kB
TypeScript
import { SingleEditorState, SingleEditorStatus } from "../../utils/enums";
import { ErrorEvent } from "./core-events.data.model";
import { User } from "./user.data.model";
export declare class LiveStateData {
/**
* Unique identifier to identify the document you are syncing.
* This id is md5 of liveStateDataId.
*/
id: string;
/**
* Unique identifier to identify the state data you are syncing.
*/
liveStateDataId: string;
/**
* The data that you want to be synced across clients on the given document.
*
*/
data: string | number | boolean | JSON;
lastUpdated: any;
updatedBy: User;
tabId?: string | null;
isDataStringified?: boolean;
}
export declare class SetLiveStateDataConfig {
/**
* To merge data with existing data.
*/
merge?: boolean;
}
export declare class SingleEditorLiveStateData {
editor?: User | null;
requestEditorAccess?: {
user: User;
requestedAt: any;
status: SingleEditorStatus;
editorAccessTimeout: number;
tabId?: string | null;
} | null;
tabId?: string | null;
editorAt?: any;
}
export declare class SingleEditorConfig {
/**
* To enable/disable custom mode.
* When custom mode is enabled, the input elements will not be disabled for viewer.
*/
customMode?: boolean;
/**
* To enable/disable editor mode on single tab only.
*/
singleTabEditor: boolean;
}
export declare class UserEditorAccess {
/**
* True if the user is editor.
*/
isEditor?: boolean;
/**
* True if the user is editor on current tab.
*/
isEditorOnCurrentTab?: boolean;
}
export declare class EditorAccessTimer {
/**
* The time when the editor access was requested.
*/
state: SingleEditorState;
/**
* Duration left for the editor access timer to be completed.
*/
durationLeft?: number;
}
export declare class LiveStateDataConfig {
listenToNewChangesOnly?: boolean;
}
export interface SetUserAsEditorResponse {
error?: ErrorEvent;
}
export interface LiveStateSingleEditorExternalUserPresence {
/**
* True if the same user is present on different tab.
*/
sameUserPresentOnTab?: boolean;
/**
* True if the different user is present on different tab.
*/
differentUserPresentOnTab?: boolean;
/**
* User ids of the users present on different tab.
*/
userIds?: string[];
}