UNPKG

3.14 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
4 * This code may only be used under the BSD style license found at
5 * http://polymer.github.io/LICENSE.txt
6 * The complete set of authors may be found at
7 * http://polymer.github.io/AUTHORS.txt
8 * The complete set of contributors may be found at
9 * http://polymer.github.io/CONTRIBUTORS.txt
10 * Code distributed by Google as part of the polymer project is also
11 * subject to an additional IP rights grant found at
12 * http://polymer.github.io/PATENTS.txt
13 */
14import * as babel from '@babel/types';
15import { Annotation as JsDocAnnotation } from '../javascript/jsdoc';
16import { AstNodeWithLanguage, Class, Document, ElementMixin, Privacy, ScannedElementMixin, ScannedMethod, ScannedReference, SourceRange } from '../model/model';
17import { LocalId, Observer, PolymerExtension, PolymerProperty, ScannedPolymerExtension, ScannedPolymerProperty } from './polymer-element';
18export interface Options {
19 name: string;
20 jsdoc: JsDocAnnotation;
21 description: string;
22 summary: string;
23 privacy: Privacy;
24 sourceRange: SourceRange;
25 mixins: ScannedReference<'element-mixin'>[];
26 astNode: AstNodeWithLanguage;
27 statementAst: babel.Statement | undefined;
28 classAstNode?: babel.Node;
29}
30export declare class ScannedPolymerElementMixin extends ScannedElementMixin implements ScannedPolymerExtension {
31 readonly properties: Map<string, ScannedPolymerProperty>;
32 readonly methods: Map<string, ScannedMethod>;
33 readonly staticMethods: Map<string, ScannedMethod>;
34 readonly observers: Observer[];
35 readonly listeners: {
36 event: string;
37 handler: string;
38 }[];
39 readonly behaviorAssignments: ScannedReference<'behavior'>[];
40 pseudo: boolean;
41 readonly abstract: boolean;
42 readonly sourceRange: SourceRange;
43 classAstNode?: babel.Node;
44 constructor({ name, jsdoc, description, summary, privacy, sourceRange, mixins, astNode, statementAst, classAstNode }: Options);
45 addProperty(prop: ScannedPolymerProperty): void;
46 addMethod(method: ScannedMethod): void;
47 resolve(document: Document): PolymerElementMixin;
48}
49declare module '../model/queryable' {
50 interface FeatureKindMap {
51 'polymer-element-mixin': PolymerElementMixin;
52 }
53}
54export declare class PolymerElementMixin extends ElementMixin implements PolymerExtension {
55 readonly properties: Map<string, PolymerProperty>;
56 readonly observers: Observer[];
57 readonly listeners: {
58 event: string;
59 handler: string;
60 }[];
61 readonly behaviorAssignments: ScannedReference<'behavior'>[];
62 readonly localIds: LocalId[];
63 readonly pseudo: boolean;
64 constructor(scannedMixin: ScannedPolymerElementMixin, document: Document);
65 emitPropertyMetadata(property: PolymerProperty): {
66 polymer: {
67 notify: boolean | undefined;
68 observer: string | undefined;
69 readOnly: boolean | undefined;
70 attributeType: string | undefined;
71 };
72 };
73 protected _getSuperclassAndMixins(document: Document, init: ScannedPolymerElementMixin): Class[];
74}