All files / parser/nodes typeDeclaration.js

83.33% Statements 5/6
0% Branches 0/2
50% Functions 1/2
83.33% Lines 5/6
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35                              36x     36x     36x     36x     36x              
import Node from './node';
 
/**
 * Wraps a type declaration
 * 
 */
export default class TypeDeclaration extends Node {
    
    constructor(
        path: Identifier[],
        optional: bool,
        parent: TypeDeclaration,
        fallback: TypeDeclaration,
        position: Object
    ) {
        super(position);
        
        /** @type {Identifier[]} */
        this.path = path;
        
        /** @type {bool} */
        this.optional = optional;
        
        /** @type {TypeDeclaration} */
        this.parent = parent;
        
        /** @type {TypeDeclaration} */
        this.fallback = fallback;
    }
    
    /** @override */
    get children() {
        return this.path ? [this.path[0]] : null;
    }
}