@foxpage/foxpage-manager
Version:
foxpage resource manager
57 lines (56 loc) • 1.83 kB
TypeScript
import { Application, FPFunction, FPFunctionItem, FunctionManager, Relations, ResourceUpdateInfo } from '@foxpage/foxpage-types';
import { ManagerBaseImpl } from '../common';
import { FPFunctionInstance } from './function';
/**
* function manager
*
* @export
* @class FunctionManager
* @extends {ManagerBaseImpl}
*/
export declare class FunctionManagerImpl extends ManagerBaseImpl<FPFunction> implements FunctionManager {
constructor(app: Application);
/**
* add function content to manager
*
* @param {FPFunction} content
*/
addFunction(content: FPFunction): FPFunctionInstance;
/**
* get function
*
* @param {string} functionId
* @return {*} {(Promise<FPFunction | undefined>)}
*/
getFunction(functionId: string): Promise<FPFunction | null>;
/**
* get function item
*
* @param {string} functionId
* @param {string} functionItemName
* @return {*} {(Promise<FPFunctionItem | undefined)}
*/
getFunctionItem(functionId: string, functionItemName: string): Promise<FPFunctionItem | null>;
/**
* get functions
*
* @param {string[]} functionIds
* @return {*} {Promise<FPFunction[]>}
*/
getFunctions(functionIds: string[]): Promise<FPFunction[]>;
/**
* fetch application functions
*/
freshFunctions(functionIds: string[]): Promise<FPFunction[]>;
/**
* remove functions via functionIds
*
* @param {string[]} functionIds
*/
removeFunctions(functionIds: string[]): void;
protected onFetch(list: string[]): Promise<FPFunction[]>;
protected onPull(data: ResourceUpdateInfo): Promise<void>;
protected onStash(data: Relations): void;
protected createInstance(data: FPFunction): Promise<FPFunctionInstance>;
private newFunction;
}