import { CodegenHelper } from "./view-ngexpression-parser"; /** * When handling an angular directive, you can generate TS source code for * type-safety testing. This is what your directive can return to ng-typeview. */ export interface DirectiveResponse { /** * The code you want to insert in the generated typescript */ source: string; /** * An optional function returning the code that'll be inserted * when this tag gets closed (typically you'll give nothing, * or `}` or `})` for instance). */ closeSource?: () => string; } /** * Allows to handle a specific angular directive, which is tied to an attribute * (so, not tied to any particular HTML tag). For instance ``. */ export interface AttributeDirectiveHandler { /** * List of attribute names which will trigger this handler. You must * use the ng-xxx syntax here (other forms present in your application's * source will get normalized to this syntax, so it'll match). */ forAttributes: string[]; /** * handle a certain attribute appearing in the view. * @param attrName The normalized name of the attribute (always in the form ng-xxx) * @param attrValue The value for the attribute * @param allAttribs The value of all the attributes on that node * @param codegenHelpers Object containing helper functions * to assist with typescript code generation * @returns The TS source to generate for that attribute, and the closing source if needed. * You can also return `undefined` in case you don't want to handle the attribute. */ handleAttribute(attrName: string, attrValue: string, allAttribs: { [type: string]: string; }, codegenHelpers: CodegenHelper): DirectiveResponse | undefined; } /** * Allows to handle a specific angular directive, which tied to a specific * HTML tag. For instance `ui-select`. */ export interface TagDirectiveHandler { /** * List of attributes this tag directive may handle. Used for the * 'unhandled attribute' warning. */ canHandleAttributes: string[]; /** * List of tag names which will trigger this handler. You must use the * ng-xxx syntax here (other forms present in your application's source * will get normalized to this syntax, so it'll match). * NOTE: If you return the empty list here, you will be called for every tag. */ forTags: string[]; /** * handle a certain tag appearing in the view. * @param tagName The normalized name of the tag (always in the form ng-xxx) * @param attribs A dictionary object, the keys being the normalized (ng-xxx) * attribute names, the value the attribute values * @param codegenHelpers Object containing helper functions * to assist with typescript code generation * @returns The TS source to generate for that attribute, and the closing source if needed. * You can also return `undefined` in case you don't want to handle the tag. */ handleTag(tagName: string, attribs: { [type: string]: string; }, codegenHelpers: CodegenHelper): DirectiveResponse | undefined; } /** * Set of angular attribute directives supported out of the box. You can give this * list in [[ProjectSettings.attributeDirectives]], or you can add your own or provide * your own list entirely. */ export declare const defaultAttrDirectiveHandlers: AttributeDirectiveHandler[]; /** * Set of angular tag directives supported out of the box. You can give this * list in [[ProjectSettings.tagDirectives]], or you can add your own or provide * your own list entirely. */ export declare const defaultTagDirectiveHandlers: TagDirectiveHandler[];