|
1 | | -import type { Identity } from './identity' |
| 1 | +import type { IdentityAny } from './identity' |
2 | 2 | import { compatibleMemberDecorator, compatibleClassDecorator } from './deco3/utils'; |
3 | 3 | import { type VueCons, Base } from './class'; |
4 | 4 | import { getSlot, type Slot, type SlotMapNames } from './slot' |
5 | 5 |
|
6 | | -export function getPrototypeOf(proto: Identity): Identity | null { |
| 6 | +export function getPrototypeOf(proto: IdentityAny): IdentityAny | null { |
7 | 7 | const p = Object.getPrototypeOf(proto) |
8 | 8 | if (!(p instanceof Base)) { |
9 | 9 | return null |
10 | 10 | } |
11 | 11 | return p |
12 | 12 | } |
13 | 13 |
|
14 | | -export function toComponentReverse(proto: Identity) { |
15 | | - const arr: Identity[] = [] |
16 | | - let curr: Identity | null = proto |
| 14 | +export function toComponentReverse(proto: IdentityAny) { |
| 15 | + const arr: IdentityAny[] = [] |
| 16 | + let curr: IdentityAny | null = proto |
17 | 17 | do { |
18 | 18 | arr.unshift(curr) |
19 | 19 | curr = getPrototypeOf(curr) |
20 | 20 | } while (curr !== null && !getSlot(curr)) |
21 | 21 | return arr |
22 | 22 | } |
23 | 23 |
|
24 | | -export function getSuperSlot(proto: Identity) { |
| 24 | +export function getSuperSlot(proto: IdentityAny) { |
25 | 25 | let curr = getPrototypeOf(proto) |
26 | 26 |
|
27 | 27 | while (curr !== null) { |
@@ -86,11 +86,11 @@ export function getProviderFunction(provide: any): () => {} { |
86 | 86 | export function optionNullableMemberDecorator<T>(handler: { (proto: any, name: string, option?: T): any }) { |
87 | 87 | function decorator(): any |
88 | 88 | function decorator(option: T): any//option |
89 | | - function decorator(proto: Identity, name: any): any//deco stage 2 |
| 89 | + function decorator(proto: IdentityAny, name: any): any//deco stage 2 |
90 | 90 | function decorator(value: any, ctx: ClassMemberDecoratorContext): any //deco stage 3 |
91 | | - function decorator(optionOrProtoOrValue?: T | Identity | any, nameOrCtx?: string | ClassMemberDecoratorContext): any { |
| 91 | + function decorator(optionOrProtoOrValue?: T | IdentityAny | any, nameOrCtx?: string | ClassMemberDecoratorContext): any { |
92 | 92 | if (nameOrCtx) {//no option |
93 | | - const protoOrValue = optionOrProtoOrValue as Identity | any |
| 93 | + const protoOrValue = optionOrProtoOrValue as IdentityAny | any |
94 | 94 | compatibleMemberDecorator(function (proto: any, name: any) { |
95 | 95 | handler(proto, name) |
96 | 96 | })(protoOrValue, nameOrCtx) |
|
0 commit comments