@stackend/api
Version:
JS bindings to api.stackend.com
80 lines • 2.21 kB
TypeScript
import { GetModulesResult, Module } from '../stackend';
import { Thunk } from '../api';
/**
* Component class: com.stackend.live.LiveEventManager
* @type {string}
*/
export declare const COMPONENT_CLASS = "com.stackend.live.LiveEventManager";
/**
* Component name: live
* @type {string}
*/
export declare const COMPONENT_NAME = "live";
/**
* Live uses the generic 'comments' context but the com.stackend.live.LiveEventManager component
* @type {string}
*/
export declare const COMPONENT_CONTEXT = "comments";
export declare enum LiveEventState {
SCHEDULED = "SCHEDULED",
ACTIVE = "ACTIVE",
COMPLETED = "COMPLETED"
}
/**
* Settings for live modules
*/
export interface LiveEventModuleSettings {
startDate?: number;
state: LiveEventState;
descriptionCmsId?: number;
showTitle: boolean;
videoId?: string;
videoUrl: string;
videoHtml?: string;
videoWidth?: number;
videoHeight?: number;
videoTitle?: string;
videoDescription?: string;
videoThumbnail?: string;
/**
* Ids of users with elevated privs
*/
trustedUsers?: Array<number>;
}
/**
* Create a new live event module
* @param communityId
* @param name
* @param settings optional settings
* @returns {*}
*/
export declare function newLiveEventModule({ communityId, name, settings }: {
communityId: number;
name: string;
settings?: Partial<LiveEventModuleSettings>;
}): Module;
/**
* Check if a module is a live event
* @param module
* @returns {boolean}
*/
export declare function isLiveEventModule(module: Module): boolean;
/**
* Get live event settings. Ensure this is a live event
* @param module
*/
export declare function getLiveEventModuleSettings(module: Module): LiveEventModuleSettings;
/**
* Filter live event modules matching a given state
* @param module
* @param state
*/
export declare function filterLiveEventModule(module: Module, state: LiveEventState): boolean;
/**
* A variation of list modules that lists only live events
*/
export declare function listLiveEvents({ pageSize, matchEnabled }: {
pageSize: number;
matchEnabled?: boolean;
}): Thunk<Promise<GetModulesResult>>;
//# sourceMappingURL=index.d.ts.map