| 36 | } |
| 37 | |
| 38 | export class Node implements IPublicModelNode { |
| 39 | private readonly [documentSymbol]: InnerDocumentModel | null; |
| 40 | private readonly [nodeSymbol]: InnerNode; |
| 41 | |
| 42 | private _id: string; |
| 43 | |
| 44 | /** |
| 45 | * 节点 id |
| 46 | */ |
| 47 | get id() { |
| 48 | return this._id; |
| 49 | } |
| 50 | |
| 51 | /** |
| 52 | * set id |
| 53 | */ |
| 54 | set id(id: string) { |
| 55 | this._id = id; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * 节点标题 |
| 60 | */ |
| 61 | get title(): string | IPublicTypeI18nData | ReactElement { |
| 62 | return this[nodeSymbol].title; |
| 63 | } |
| 64 | |
| 65 | /** |
| 66 | * @deprecated |
| 67 | * 是否为「容器型」节点 |
| 68 | */ |
| 69 | get isContainer(): boolean { |
| 70 | return this[nodeSymbol].isContainerNode; |
| 71 | } |
| 72 | |
| 73 | /** |
| 74 | * 是否为「容器型」节点 |
| 75 | */ |
| 76 | get isContainerNode(): boolean { |
| 77 | return this[nodeSymbol].isContainerNode; |
| 78 | } |
| 79 | |
| 80 | /** |
| 81 | * @deprecated |
| 82 | * 是否为根节点 |
| 83 | */ |
| 84 | get isRoot(): boolean { |
| 85 | return this[nodeSymbol].isRootNode; |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * 是否为根节点 |
| 90 | */ |
| 91 | get isRootNode(): boolean { |
| 92 | return this[nodeSymbol].isRootNode; |
| 93 | } |
| 94 | |
| 95 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…