@omnia/tooling-composers
Version:
Provide tooling to work with manifest things.
78 lines (77 loc) • 3.98 kB
TypeScript
import { IBlockingComposer } from "./BlockingComposer";
import { ResourcesOptions, WebComponentOptions, ILocalizationComposer, ManifestGroupOptions, LocalizationOptions, ServiceFeatureOption, ServiceAppDefinitionOption, ServiceRoleDefinitionOption } from "./models";
import { IResourcesComposer, IReOpendedResourcesComposer } from "./ResourcesComposer";
import { IWebComponentComposer } from "./ComponentComposer";
import { IManifestGroupComposer } from "./ManifestGroupComposer";
import { IRegisterService } from './ServiceComposer';
import { Guid, GuidValue } from '../../fx-models';
import { IClientServiceConfigurator } from '.';
import { IServiceFeatureComposer } from "./ServiceFeatureComposer";
export interface IComposerDone<T> {
done: () => T;
}
export interface INewManifestComposer extends IRegisterService {
/**
* Registers a new web component manifest
* A web component is the key entity for a modular UI, each
* web component can be loaded separately when required.
* A web component will be loaded as soon as the matching element name appears in the HTML DOM.
* Additional load rules can be added.
* Usage: registerWebComponent({...}).*additionalOperations
* @param componentOptions the options for the webcomponent
*/
registerWebComponent: (componentOptions: WebComponentOptions) => IWebComponentComposer;
/**
* Registers a new resources manifest
* Usage: registerResource({...}).*additionalOperations
* @param resourcesOptions the options for defining the resources.
*/
registerResources: (resourcesOptions: ResourcesOptions) => IResourcesComposer;
/**
* Registers a new resource group manifest
* This type of manifest groups your webcomponent and resources into a group, all web components and resources
* in the group will be loaded as one bundle.
* Usage: registerResourceGroup({...}).*additionalOperations
* @param groupOptions the options for the defining the webcomponent group.
*/
registerResourceGroup: (groupOptions: ManifestGroupOptions) => IManifestGroupComposer;
/**
* Registers a new localization manifest
* Used to add labels for localization
* Usage: registerLocalization("").*additionalOperations
* @param lcid the language..
*/
registerLocalization: (localizationOptions?: LocalizationOptions) => ILocalizationComposer;
registerFeature: (options: ServiceFeatureOption) => IServiceFeatureComposer;
registerAppDefinition: (options: ServiceAppDefinitionOption) => void;
registerRoleDefinition: (option: ServiceRoleDefinitionOption) => void;
}
export declare class Composer {
/** Do not instantiate, use static members instead of constructor / new Composer().
E.g. Composer.registerComponent()
*/
constructor();
/**
* Registers a new manifest
* @param manifestId the unique id of the manifest, must be a valid guid.
* @param name a friendly name of the manifest.
*/
static registerManifest: (manifestId: GuidValue, name?: string) => INewManifestComposer;
/**
* Re-opens resources manifest, so more resources can be included.
* {param}:manifestId the unique id of the resource manifest to open, must be a valid guid.
*/
static openResourceManifest: (manifestId: GuidValue) => IReOpendedResourcesComposer;
/** Add information about things you want to block.
E.g. block a manifest from being loaded, so you can provide your own implementation
*/
static get block(): IBlockingComposer;
static importManifests: (folderPath: string) => {
configuration: <T extends IClientServiceConfigurator<Composer>>(omniaServiceId: Guid, configurationType: any) => T;
done: () => {
registerManifest: (manifestId: GuidValue, name?: string) => INewManifestComposer;
openResourceManifest: (manifestId: GuidValue) => IReOpendedResourcesComposer;
block: IBlockingComposer;
};
};
}