From a039e11efadfe32ed3df10c9c212e25951bd38c3 Mon Sep 17 00:00:00 2001 From: Roman Dvornov Date: Wed, 6 Dec 2023 17:37:34 +0100 Subject: [PATCH] Tweak stat API description --- docs/articles/api.md | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/articles/api.md b/docs/articles/api.md index 27dc932..ec15228 100644 --- a/docs/articles/api.md +++ b/docs/articles/api.md @@ -216,31 +216,31 @@ statApi.suggestion(6); // .[foo=|] Output format: ```ts - suggestion(): Array<{ - context: 'path' | 'key' | 'value' | 'in-value' | 'value-subset' | 'var', - from: number, - to: number, - text: string, - values: Set, - related: Set | null - }> | null + stat(): Array<{ + context: 'path' | 'key' | 'value' | 'in-value' | 'value-subset' | 'var' | 'assertion', + from: number, + to: number, + text: string, + values: Set, + related: Set | null + }> | null ``` - `suggestion(pos: number, options?)` - Returns suggesion values grouped by a type or `null` if there is no any suggestions. The following options are supported (all are optional): - - `limit` (default: `Infinity`) – a max number of the values that should be returned for each value type (`"property"`, `"value"` or `"variable"`) + Returns suggesion values grouped by a type or `null` if there is no any suggestions. The following `options` are supported (all are optional): + - `limit` (default: `Infinity`) – a max number of the values that should be returned for each value type (`"property"`, `"value"`, `"variable"`, `"assertion"`) - `sort` (default: `false`) – a comparator function (should take 2 arguments and return a negative number, `0` or a positive number) for value list sorting, makes sence when `limit` is used - `filter` (default: `function`) – a filter function factory (`pattern => value => `) to discard values from the result when returns a falsy value (default is equivalent to `patttern => value => String(value).toLowerCase().includes(pattern)`) Output format: ```ts - suggestion(): Array<{ - type: 'property' | 'value' | 'variable', - from: number, - to: number, - text: string, - suggestions: Array - }> | null + suggestion(): Array<{ + type: 'property' | 'value' | 'variable' | 'assertion', + from: number, + to: number, + text: string, + suggestions: Array + }> | null ```