UNPKG

1.68 kBTypeScriptView Raw
1/** @publicapi @module ng1 */ /** */
2import { StateObject, ViewConfig, ViewConfigFactory, PathNode, ResolveContext, IInjectable } from '@uirouter/core';
3import { Ng1ViewDeclaration } from '../interface';
4import { TemplateFactory } from '../templateFactory';
5/** @internalapi */
6export declare function getNg1ViewConfigFactory(): ViewConfigFactory;
7/**
8 * This is a [[StateBuilder.builder]] function for angular1 `views`.
9 *
10 * When the [[StateBuilder]] builds a [[StateObject]] object from a raw [[StateDeclaration]], this builder
11 * handles the `views` property with logic specific to @uirouter/angularjs (ng1).
12 *
13 * If no `views: {}` property exists on the [[StateDeclaration]], then it creates the `views` object
14 * and applies the state-level configuration to a view named `$default`.
15 *
16 * @internalapi
17 */
18export declare function ng1ViewsBuilder(state: StateObject): {
19 [key: string]: Ng1ViewDeclaration;
20};
21/** @internalapi */
22export declare class Ng1ViewConfig implements ViewConfig {
23 path: PathNode[];
24 viewDecl: Ng1ViewDeclaration;
25 factory: TemplateFactory;
26 $id: number;
27 loaded: boolean;
28 controller: Function;
29 template: string;
30 component: string;
31 locals: any;
32 constructor(path: PathNode[], viewDecl: Ng1ViewDeclaration, factory: TemplateFactory);
33 load(): Promise<this>;
34 getTemplate: (uiView: any, context: ResolveContext) => string;
35 /**
36 * Gets the controller for a view configuration.
37 *
38 * @returns {Function|Promise.<Function>} Returns a controller, or a promise that resolves to a controller.
39 */
40 getController(context: ResolveContext): IInjectable | string | Promise<IInjectable | string>;
41}