|
| 1 | +=== tests/cases/compiler/Element.ts === |
| 2 | + |
| 3 | +declare namespace JSX { |
| 4 | +>JSX : Symbol(JSX, Decl(Element.ts, 0, 0)) |
| 5 | + |
| 6 | + interface Element { |
| 7 | +>Element : Symbol(Element, Decl(Element.ts, 1, 23)) |
| 8 | + |
| 9 | + name: string; |
| 10 | +>name : Symbol(Element.name, Decl(Element.ts, 2, 23)) |
| 11 | + |
| 12 | + isIntrinsic: boolean; |
| 13 | +>isIntrinsic : Symbol(Element.isIntrinsic, Decl(Element.ts, 3, 21)) |
| 14 | + |
| 15 | + isCustomElement: boolean; |
| 16 | +>isCustomElement : Symbol(Element.isCustomElement, Decl(Element.ts, 4, 29)) |
| 17 | + |
| 18 | + toString(renderId?: number): string; |
| 19 | +>toString : Symbol(Element.toString, Decl(Element.ts, 5, 33)) |
| 20 | +>renderId : Symbol(renderId, Decl(Element.ts, 6, 17)) |
| 21 | + |
| 22 | + bindDOM(renderId?: number): number; |
| 23 | +>bindDOM : Symbol(Element.bindDOM, Decl(Element.ts, 6, 44)) |
| 24 | +>renderId : Symbol(renderId, Decl(Element.ts, 7, 16)) |
| 25 | + |
| 26 | + resetComponent(): void; |
| 27 | +>resetComponent : Symbol(Element.resetComponent, Decl(Element.ts, 7, 43)) |
| 28 | + |
| 29 | + instantiateComponents(renderId?: number): number; |
| 30 | +>instantiateComponents : Symbol(Element.instantiateComponents, Decl(Element.ts, 8, 31)) |
| 31 | +>renderId : Symbol(renderId, Decl(Element.ts, 9, 30)) |
| 32 | + |
| 33 | + props: any; |
| 34 | +>props : Symbol(Element.props, Decl(Element.ts, 9, 57)) |
| 35 | + } |
| 36 | +} |
| 37 | +export namespace Element { |
| 38 | +>Element : Symbol(Element, Decl(Element.ts, 12, 1)) |
| 39 | + |
| 40 | + export function isElement(el: any): el is JSX.Element { |
| 41 | +>isElement : Symbol(isElement, Decl(Element.ts, 13, 26)) |
| 42 | +>el : Symbol(el, Decl(Element.ts, 14, 30)) |
| 43 | +>el : Symbol(el, Decl(Element.ts, 14, 30)) |
| 44 | +>JSX : Symbol(JSX, Decl(Element.ts, 0, 0)) |
| 45 | +>Element : Symbol(JSX.Element, Decl(Element.ts, 1, 23)) |
| 46 | + |
| 47 | + return el.markAsChildOfRootElement !== undefined; |
| 48 | +>el : Symbol(el, Decl(Element.ts, 14, 30)) |
| 49 | +>undefined : Symbol(undefined) |
| 50 | + } |
| 51 | + |
| 52 | + export function createElement(args: any[]) { |
| 53 | +>createElement : Symbol(createElement, Decl(Element.ts, 16, 5)) |
| 54 | +>args : Symbol(args, Decl(Element.ts, 18, 34)) |
| 55 | + |
| 56 | + return { |
| 57 | + } |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +export let createElement = Element.createElement; |
| 62 | +>createElement : Symbol(createElement, Decl(Element.ts, 25, 10)) |
| 63 | +>Element.createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5)) |
| 64 | +>Element : Symbol(Element, Decl(Element.ts, 12, 1)) |
| 65 | +>createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5)) |
| 66 | + |
| 67 | +function toCamelCase(text: string): string { |
| 68 | +>toCamelCase : Symbol(toCamelCase, Decl(Element.ts, 25, 49)) |
| 69 | +>text : Symbol(text, Decl(Element.ts, 27, 21)) |
| 70 | + |
| 71 | + return text[0].toLowerCase() + text.substring(1); |
| 72 | +>text[0].toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) |
| 73 | +>text : Symbol(text, Decl(Element.ts, 27, 21)) |
| 74 | +>toLowerCase : Symbol(String.toLowerCase, Decl(lib.es5.d.ts, --, --)) |
| 75 | +>text.substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) |
| 76 | +>text : Symbol(text, Decl(Element.ts, 27, 21)) |
| 77 | +>substring : Symbol(String.substring, Decl(lib.es5.d.ts, --, --)) |
| 78 | +} |
| 79 | + |
| 80 | +=== tests/cases/compiler/test.tsx === |
| 81 | +import { Element} from './Element'; |
| 82 | +>Element : Symbol(Element, Decl(test.tsx, 0, 8)) |
| 83 | + |
| 84 | +let createElement = Element.createElement; |
| 85 | +>createElement : Symbol(createElement, Decl(test.tsx, 1, 3)) |
| 86 | +>Element.createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5)) |
| 87 | +>Element : Symbol(Element, Decl(test.tsx, 0, 8)) |
| 88 | +>createElement : Symbol(Element.createElement, Decl(Element.ts, 16, 5)) |
| 89 | + |
| 90 | +let c: { |
| 91 | +>c : Symbol(c, Decl(test.tsx, 2, 3)) |
| 92 | + |
| 93 | + a?: { |
| 94 | +>a : Symbol(a, Decl(test.tsx, 2, 8)) |
| 95 | + |
| 96 | + b: string |
| 97 | +>b : Symbol(b, Decl(test.tsx, 3, 6)) |
| 98 | + } |
| 99 | +}; |
| 100 | + |
| 101 | +class A { |
| 102 | +>A : Symbol(A, Decl(test.tsx, 6, 2)) |
| 103 | + |
| 104 | + view() { |
| 105 | +>view : Symbol(A.view, Decl(test.tsx, 8, 9)) |
| 106 | + |
| 107 | + return [ |
| 108 | + <meta content="helloworld"></meta>, |
| 109 | +>meta : Symbol(unknown) |
| 110 | +>content : Symbol(unknown) |
| 111 | +>meta : Symbol(unknown) |
| 112 | + |
| 113 | + <meta content={c.a!.b}></meta> |
| 114 | +>meta : Symbol(unknown) |
| 115 | +>content : Symbol(unknown) |
| 116 | +>c.a!.b : Symbol(b, Decl(test.tsx, 3, 6)) |
| 117 | +>c.a : Symbol(a, Decl(test.tsx, 2, 8)) |
| 118 | +>c : Symbol(c, Decl(test.tsx, 2, 3)) |
| 119 | +>a : Symbol(a, Decl(test.tsx, 2, 8)) |
| 120 | +>b : Symbol(b, Decl(test.tsx, 3, 6)) |
| 121 | +>meta : Symbol(unknown) |
| 122 | + |
| 123 | + ]; |
| 124 | + } |
| 125 | +} |
0 commit comments