diff --git a/packages/typedoc-signature/fixtures/000/test.ts b/packages/typedoc-signature/fixtures/000/test.ts index cf9ec7f29..8b2f64cf7 100644 --- a/packages/typedoc-signature/fixtures/000/test.ts +++ b/packages/typedoc-signature/fixtures/000/test.ts @@ -1,13 +1,9 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" export const name = "computing the signature with empty file" export const collection: DeclarationEntity[] = [] -let e0: Entity -e0 = new DeclarationEntity() +const e0 = new DeclarationEntity() e0.id = 0 collection.push(e0) diff --git a/packages/typedoc-signature/fixtures/001/test.ts b/packages/typedoc-signature/fixtures/001/test.ts index ef39b40c1..6f4798294 100644 --- a/packages/typedoc-signature/fixtures/001/test.ts +++ b/packages/typedoc-signature/fixtures/001/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for functions without parameters" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/002/test.ts b/packages/typedoc-signature/fixtures/002/test.ts index b65e5088f..955f08726 100644 --- a/packages/typedoc-signature/fixtures/002/test.ts +++ b/packages/typedoc-signature/fixtures/002/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -16,15 +15,13 @@ import { export const name = "computing the signature for functions with one parameter" export const collection: DeclarationEntity[] = [] -let e0: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 -f0 = new Fragment() f0.name = "p0" t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/003/test.ts b/packages/typedoc-signature/fixtures/003/test.ts index 0851eb3f5..cfac991c8 100644 --- a/packages/typedoc-signature/fixtures/003/test.ts +++ b/packages/typedoc-signature/fixtures/003/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -16,15 +15,13 @@ import { export const name = "computing the signature for functions with array parameter" export const collection: DeclarationEntity[] = [] -let e0: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 -f0 = new Fragment() f0.name = "p0" t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/004/test.ts b/packages/typedoc-signature/fixtures/004/test.ts index 3d372666c..24b1d7f60 100644 --- a/packages/typedoc-signature/fixtures/004/test.ts +++ b/packages/typedoc-signature/fixtures/004/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -16,16 +15,14 @@ import { export const name = "computing the signature for functions with two parameter" export const collection: DeclarationEntity[] = [] -let e0: Entity -let f0: Fragment -let f1: Fragment +const e0 = new DeclarationEntity() +const f0 = new Fragment() +const f1 = new Fragment() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 -f0 = new Fragment() f0.name = "p0" t = new TypeToken() @@ -35,7 +32,6 @@ s.push(t) f0.signature.concise.push(...s) s = [] -f1 = new Fragment() f1.name = "p1" t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/005/test.ts b/packages/typedoc-signature/fixtures/005/test.ts index dd70238ee..c32383b8c 100644 --- a/packages/typedoc-signature/fixtures/005/test.ts +++ b/packages/typedoc-signature/fixtures/005/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -17,15 +16,13 @@ export const name = "computing the signature for functions with optional parameter" export const collection: DeclarationEntity[] = [] -let e0: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 -f0 = new Fragment() f0.name = "p0" f0.optional = true diff --git a/packages/typedoc-signature/fixtures/006/test.ts b/packages/typedoc-signature/fixtures/006/test.ts index 50bfaeb5c..8bfd66e6f 100644 --- a/packages/typedoc-signature/fixtures/006/test.ts +++ b/packages/typedoc-signature/fixtures/006/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -18,15 +17,13 @@ export const name = "computing the signature for functions with a default value parameter" export const collection: DeclarationEntity[] = [] -let e0: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 -f0 = new Fragment() f0.name = "p0" f0.default = "v0" @@ -72,7 +69,7 @@ t.text = " = " s.push(t) t = new StringToken() -t.text = "\"v0\"" +t.text = '"s"' s.push(t) t = new TextToken() diff --git a/packages/typedoc-signature/fixtures/007/test.ts b/packages/typedoc-signature/fixtures/007/test.ts index 9c4ae164d..782fd1a3a 100644 --- a/packages/typedoc-signature/fixtures/007/test.ts +++ b/packages/typedoc-signature/fixtures/007/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for functions with a returned value type - string" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/008/test.ts b/packages/typedoc-signature/fixtures/008/test.ts index 272e3aeac..c1973e28e 100644 --- a/packages/typedoc-signature/fixtures/008/test.ts +++ b/packages/typedoc-signature/fixtures/008/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ export const name = "computing the signature for functions with a returned value type - object" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/009/test.ts b/packages/typedoc-signature/fixtures/009/test.ts index 5dfc17800..bd1284ed4 100644 --- a/packages/typedoc-signature/fixtures/009/test.ts +++ b/packages/typedoc-signature/fixtures/009/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -15,11 +12,10 @@ import { export const name = "computing the signature for class" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/010/test.ts b/packages/typedoc-signature/fixtures/010/test.ts index ecd4f3349..07c4d8133 100644 --- a/packages/typedoc-signature/fixtures/010/test.ts +++ b/packages/typedoc-signature/fixtures/010/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a class with property" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/011/test.ts b/packages/typedoc-signature/fixtures/011/test.ts index b5be457f6..ad9c9825a 100644 --- a/packages/typedoc-signature/fixtures/011/test.ts +++ b/packages/typedoc-signature/fixtures/011/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a class with flags on the properties (private, protected, public, static, private static)" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/012/test.ts b/packages/typedoc-signature/fixtures/012/test.ts index 74367b4e6..9aa0fcade 100644 --- a/packages/typedoc-signature/fixtures/012/test.ts +++ b/packages/typedoc-signature/fixtures/012/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a class properties, constructor and method" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/013/test.ts b/packages/typedoc-signature/fixtures/013/test.ts index b1ae31b45..fd4b38b5c 100644 --- a/packages/typedoc-signature/fixtures/013/test.ts +++ b/packages/typedoc-signature/fixtures/013/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a abstract class with static readonly property" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/014/test.ts b/packages/typedoc-signature/fixtures/014/test.ts index 88cbaa181..02a46f851 100644 --- a/packages/typedoc-signature/fixtures/014/test.ts +++ b/packages/typedoc-signature/fixtures/014/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -15,11 +12,10 @@ import { export const name = "computing the signature for a extends class" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 5 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/015/test.ts b/packages/typedoc-signature/fixtures/015/test.ts index a16c06e27..aa5a5f046 100644 --- a/packages/typedoc-signature/fixtures/015/test.ts +++ b/packages/typedoc-signature/fixtures/015/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -15,11 +12,10 @@ import { export const name = "computing the signature for a interface" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/016/test.ts b/packages/typedoc-signature/fixtures/016/test.ts index 911278ce2..c313088e9 100644 --- a/packages/typedoc-signature/fixtures/016/test.ts +++ b/packages/typedoc-signature/fixtures/016/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a interface with properties and method" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/017/test.ts b/packages/typedoc-signature/fixtures/017/test.ts index 224a50da5..996c9a10d 100644 --- a/packages/typedoc-signature/fixtures/017/test.ts +++ b/packages/typedoc-signature/fixtures/017/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -17,11 +14,10 @@ import { export const name = "computing the signature for a enum" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/018/test.ts b/packages/typedoc-signature/fixtures/018/test.ts index 2316ca067..08208c26b 100644 --- a/packages/typedoc-signature/fixtures/018/test.ts +++ b/packages/typedoc-signature/fixtures/018/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -15,11 +12,10 @@ import { export const name = "computing the signature for a alias type" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/019/test.ts b/packages/typedoc-signature/fixtures/019/test.ts index 213df9872..6e605454c 100644 --- a/packages/typedoc-signature/fixtures/019/test.ts +++ b/packages/typedoc-signature/fixtures/019/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for a variable with type number" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -34,7 +30,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/020/test.ts b/packages/typedoc-signature/fixtures/020/test.ts index d51295b67..905dab26a 100644 --- a/packages/typedoc-signature/fixtures/020/test.ts +++ b/packages/typedoc-signature/fixtures/020/test.ts @@ -1,11 +1,8 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, - Reference, + type Reference, type Signature, TextToken, type Token, @@ -15,11 +12,10 @@ import { export const name = "computing the signature for a variable with type string" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -35,7 +31,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/021/test.ts b/packages/typedoc-signature/fixtures/021/test.ts index d67a3c940..e1c000247 100644 --- a/packages/typedoc-signature/fixtures/021/test.ts +++ b/packages/typedoc-signature/fixtures/021/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for a 'let' variable" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -34,7 +30,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/022/test.ts b/packages/typedoc-signature/fixtures/022/test.ts index 27ce00380..d8dff81b9 100644 --- a/packages/typedoc-signature/fixtures/022/test.ts +++ b/packages/typedoc-signature/fixtures/022/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for a 'var' variable" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -34,7 +30,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/023/test.ts b/packages/typedoc-signature/fixtures/023/test.ts index a6d141c48..246acc0a4 100644 --- a/packages/typedoc-signature/fixtures/023/test.ts +++ b/packages/typedoc-signature/fixtures/023/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for a variable with type array" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -34,7 +30,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TextToken() diff --git a/packages/typedoc-signature/fixtures/024/test.ts b/packages/typedoc-signature/fixtures/024/test.ts index 99e05a96d..5410a34d0 100644 --- a/packages/typedoc-signature/fixtures/024/test.ts +++ b/packages/typedoc-signature/fixtures/024/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -14,11 +11,10 @@ import { export const name = "computing the signature for a variable with type promise" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -34,7 +30,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/025/test.ts b/packages/typedoc-signature/fixtures/025/test.ts index d43a98f3c..593fb782e 100644 --- a/packages/typedoc-signature/fixtures/025/test.ts +++ b/packages/typedoc-signature/fixtures/025/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -16,15 +15,13 @@ import { export const name = "computing the signature for a function with generics" export const collection: DeclarationEntity[] = [] -let e0: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token -e0 = new DeclarationEntity() e0.id = 2 -f0 = new Fragment() f0.name = "v" t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/026/test.ts b/packages/typedoc-signature/fixtures/026/test.ts index 75e957f03..35c3c23b1 100644 --- a/packages/typedoc-signature/fixtures/026/test.ts +++ b/packages/typedoc-signature/fixtures/026/test.ts @@ -1,11 +1,8 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, - Reference, + type Reference, type Signature, TextToken, type Token, @@ -15,11 +12,10 @@ import { export const name = "computing the signature for a variable with type tuple" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -35,7 +31,7 @@ t.text = "v" s.push(t) t = new TextToken() -t.text = " = " +t.text = ": " s.push(t) t = new TextToken() diff --git a/packages/typedoc-signature/fixtures/027/test.ts b/packages/typedoc-signature/fixtures/027/test.ts index 445457d67..abbbc55c5 100644 --- a/packages/typedoc-signature/fixtures/027/test.ts +++ b/packages/typedoc-signature/fixtures/027/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -13,14 +10,13 @@ import { TypeToken, } from "@onlyoffice/signature" -export const name = "computing the signature for a variable with type tuple" +export const name = "computing the signature for a template literal type" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 3 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/028/test.ts b/packages/typedoc-signature/fixtures/028/test.ts index f37995c18..6cea2a006 100644 --- a/packages/typedoc-signature/fixtures/028/test.ts +++ b/packages/typedoc-signature/fixtures/028/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -17,11 +14,10 @@ export const name = "computing the signature for a interface with function property" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/029/test.ts b/packages/typedoc-signature/fixtures/029/test.ts index d5d8d4aae..d0b63e47b 100644 --- a/packages/typedoc-signature/fixtures/029/test.ts +++ b/packages/typedoc-signature/fixtures/029/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -17,11 +14,10 @@ import { export const name = "computing the signature for a type with template literal type" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/030/test.ts b/packages/typedoc-signature/fixtures/030/test.ts index 93a2ca9bb..1589128f8 100644 --- a/packages/typedoc-signature/fixtures/030/test.ts +++ b/packages/typedoc-signature/fixtures/030/test.ts @@ -1,14 +1,10 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, ParameterToken, Reference, type Signature, - StringToken, TextToken, type Token, TypeToken, @@ -17,11 +13,10 @@ import { export const name = "computing the signature for a enum without value" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/031/test.ts b/packages/typedoc-signature/fixtures/031/test.ts index e74a6d36f..42bab1a54 100644 --- a/packages/typedoc-signature/fixtures/031/test.ts +++ b/packages/typedoc-signature/fixtures/031/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -17,13 +16,12 @@ import { export const name = "computing the signature for a generics in method" export const collection: DeclarationEntity[] = [] -let e0: Entity -let e1: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const e1 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -128,10 +126,8 @@ s = [] collection.push(e0) -e1 = new DeclarationEntity() e1.id = 4 -f0 = new Fragment() f0.name = "p" t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/032/test.ts b/packages/typedoc-signature/fixtures/032/test.ts index f67e2e8d4..ff5cbf552 100644 --- a/packages/typedoc-signature/fixtures/032/test.ts +++ b/packages/typedoc-signature/fixtures/032/test.ts @@ -1,5 +1,4 @@ import { - type Entity, DeclarationEntity, Fragment, } from "@onlyoffice/library-declaration/next.ts" @@ -17,13 +16,12 @@ import { export const name = "computing the signature for a generics in method and returns type" export const collection: DeclarationEntity[] = [] -let e0: Entity -let e1: Entity -let f0: Fragment +const e0 = new DeclarationEntity() +const e1 = new DeclarationEntity() +const f0 = new Fragment() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() @@ -128,10 +126,8 @@ s = [] collection.push(e0) -e1 = new DeclarationEntity() e1.id = 4 -f0 = new Fragment() f0.name = "p" t = new TypeToken() diff --git a/packages/typedoc-signature/fixtures/033/test.ts b/packages/typedoc-signature/fixtures/033/test.ts index dc7b8c44c..bc38a2aa3 100644 --- a/packages/typedoc-signature/fixtures/033/test.ts +++ b/packages/typedoc-signature/fixtures/033/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a interface with index signatures" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/034/test.ts b/packages/typedoc-signature/fixtures/034/test.ts index a930656d4..be511ac65 100644 --- a/packages/typedoc-signature/fixtures/034/test.ts +++ b/packages/typedoc-signature/fixtures/034/test.ts @@ -1,7 +1,4 @@ -import { - type Entity, - DeclarationEntity, -} from "@onlyoffice/library-declaration/next.ts" +import {DeclarationEntity} from "@onlyoffice/library-declaration/next.ts" import { EntityToken, KeywordToken, @@ -16,11 +13,10 @@ import { export const name = "computing the signature for a interface with two index signatures" export const collection: DeclarationEntity[] = [] -let e0: Entity +const e0 = new DeclarationEntity() let s: Signature = [] let t: Token | Reference -e0 = new DeclarationEntity() e0.id = 2 t = new KeywordToken() diff --git a/packages/typedoc-signature/fixtures/035/main.ts b/packages/typedoc-signature/fixtures/035/main.ts new file mode 100644 index 000000000..319a402f9 --- /dev/null +++ b/packages/typedoc-signature/fixtures/035/main.ts @@ -0,0 +1 @@ +function f(...p0: string[]): void {} diff --git a/packages/typedoc-signature/fixtures/035/test.ts b/packages/typedoc-signature/fixtures/035/test.ts new file mode 100644 index 000000000..a9cad3cc7 --- /dev/null +++ b/packages/typedoc-signature/fixtures/035/test.ts @@ -0,0 +1,117 @@ +import { + DeclarationEntity, + Fragment, +} from "@onlyoffice/library-declaration/next.ts" +import { + EntityToken, + KeywordToken, + ParameterToken, + type Signature, + TextToken, + type Token, + TypeToken, +} from "@onlyoffice/signature" + +export const name = "computing the signature for functions with one parameter" +export const collection: DeclarationEntity[] = [] + +const e0 = new DeclarationEntity() +const f0 = new Fragment() +let s: Signature = [] +let t: Token + +e0.id = 2 + +f0.name = "p0" + +t = new TypeToken() +t.text = "string" +s.push(t) + +t = new TextToken() +t.text = "[]" +s.push(t) + +f0.signature.concise.push(...s) +s = [] + +e0.declaration.parameters.push(f0) + +t = new KeywordToken() +t.text = "function" +s.push(t) + +t = new TextToken() +t.text = " " +s.push(t) + +t = new EntityToken() +t.text = "f" +s.push(t) + +t = new TextToken() +t.text = "(" +s.push(t) + +t = new TextToken() +t.text = "..." +s.push(t) + +t = new ParameterToken() +t.text = "p0" +s.push(t) + +t = new TextToken() +t.text = ": " +s.push(t) + +t = new TypeToken() +t.text = "string[]" +s.push(t) + +t = new TextToken() +t.text = ")" +s.push(t) + +t = new TextToken() +t.text = ": " +s.push(t) + +t = new TypeToken() +t.text = "void" +s.push(t) + +e0.declaration.signature.verbose.push(...s) +s = [] + +t = new TextToken() +t.text = "(" +s.push(t) + +t = new TextToken() +t.text = "p0" +s.push(t) + +t = new TextToken() +t.text = ")" +s.push(t) + +t = new TextToken() +t.text = ": " +s.push(t) + +t = new TypeToken() +t.text = "void" +s.push(t) + +e0.declaration.signature.concise.push(...s) +s = [] + +t = new TypeToken() +t.text = "void" +s.push(t) + +e0.declaration.returns.signature.concise.push(...s) +s = [] + +collection.push(e0) diff --git a/packages/typedoc-signature/fixtures/035/tsconfig.json b/packages/typedoc-signature/fixtures/035/tsconfig.json new file mode 100644 index 000000000..b902c7ef4 --- /dev/null +++ b/packages/typedoc-signature/fixtures/035/tsconfig.json @@ -0,0 +1,3 @@ +{ + "exclude": ["test.ts"] +}