@stackend/api
Version:
JS bindings to api.stackend.com
102 lines • 3.26 kB
TypeScript
export declare enum ModuleType {
/** Styling */
GLOBAL_STYLE = "stackend-global-style",
/** Feed (variation of blog) */
FEED = "stackend-feed",
FAQ = "stackend-faq",
/** Login link and user menu */
LOGIN = "stackend-login",
/** Profile popup */
PROFILE = "stackend-profile",
/** Comments */
COMMENTS = "stackend-comment",
/** A single code bin */
CMS = "stackend-cms",
/** Blog (variation of feed) */
BLOG = "stackend-blog",
/** Different throbbers */
THROBBER = "stackend-throbber",
/** Purely presentational */
SLIDESHOW = "stackend-slideshow",
/** Combines content into a page */
PAGE = "stackend-page",
/** A container that allows the user to navigate pages, much like an iframe */
SUBSITE = "stackend-site",
/** A single product from the shop */
SHOP_PRODUCT = "stackend-shop-product",
/** List products from the shop */
SHOP_PRODUCT_LISTING = "stackend-shop-listing",
/** A collection of products from the shop */
SHOP_COLLECTION = "stackend-shop-collection",
/** The shopping basket and checkout user interface */
SHOP_BASKET = "stackend-shop-basket",
/** Live Event with video and chat */
LIVE = "stackend-live",
/** Listing of Live Events */
LIVE_LISTING = "stackend-live-listing",
/** Forums */
FORUM = "stackend-forum"
}
export interface ModuleInfo {
/** Human-readable name */
name: string;
/** Type */
type: ModuleType;
/** Only a single instance of this module may exist */
singleton: boolean;
/** Should this module be added automatically? */
addAutomatically: boolean;
/** Parameters required by this module */
parameters: Array<string>;
/** The id is just the community id, not a module id */
simpleId: boolean;
/** Does this module require data to be fetched? */
fetchData: boolean;
/** May this module contain sub modules? */
complex: boolean;
/** Component name */
xcapModuleType: string | null;
/** Component context */
defaultContext: string | null;
}
export declare const MODULE_INFO: {
[moduleType: string]: ModuleInfo;
};
/**
* The module types that should be added automatically
*/
export declare const AUTOMATIC_MODULE_TYPES: Array<ModuleType>;
/**
* Get module info
* @param moduleType
* @returns ModuleInfo
*/
export declare function getModuleInfo(moduleType: ModuleType): ModuleInfo | null;
/**
* Translate a ModuleType to a value accepted by index.ts
* @param moduleType
* @returns {string}
*/
export declare function getXcapModuleType(moduleType: ModuleType): string;
/**
* Get the default component context of a module type
* @param moduleType
*/
export declare function getDefaultComponentContext(moduleType: ModuleType): string;
/**
* Get a human readable label for the module type
* @param moduleType
* @returns {string}
*/
export declare function getModuleLabel(moduleType: ModuleType): string;
/**
* Add module info
* @param moduleInfo
*/
export declare function addModuleInfo(moduleInfo: ModuleInfo): void;
/**
* Remove module info
* @param moduleType
*/
export declare function removeModuleInfo(moduleType: ModuleType): void;
//# sourceMappingURL=modules.d.ts.map