@coveo/quantic 3.14.1 → 3.14.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/force-app/main/default/staticresources/coveobueno/definitions/index.d.ts +7 -7
- package/force-app/main/default/staticresources/coveobueno/definitions/values/boolean-value.d.ts +2 -2
- package/force-app/main/default/staticresources/coveobueno/definitions/values/complex-value.d.ts +5 -5
- package/force-app/main/default/staticresources/coveobueno/definitions/values/enum-value.d.ts +2 -2
- package/force-app/main/default/staticresources/coveobueno/definitions/values/number-value.d.ts +2 -2
- package/force-app/main/default/staticresources/coveobueno/definitions/values/string-value.d.ts +2 -2
- package/force-app/main/default/staticresources/coveobueno/definitions/values/value.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +9 -7
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/commerce/common/product.d.ts +6 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/api/knowledge/stream-answer-api.d.ts +1 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/app/commerce-ssr-engine/types/core-engine.d.ts +9 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/category-facet/headless-core-category-facet-options.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/facet/headless-core-facet-options.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-core-date-filter.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/date-facet/headless-date-facet-options.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-core-numeric-filter.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/core/facets/range-facet/numeric-facet/headless-numeric-facet-options.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/controllers/facets/facet/headless-facet-options.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/category-facet-set/category-facet-set-actions.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-api/request.d.ts +4 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/facet-set/facet-set-actions.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/date-facet-set/date-facet-actions.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/facets/range-facets/numeric-facet-set/numeric-facet-actions.d.ts +3 -1
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-actions.d.ts +1 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/features/generated-answer/generated-answer-state.d.ts +4 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/fetch-event-source/fetch.d.ts +44 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/fetch-event-source/index.d.ts +2 -0
- package/force-app/main/default/staticresources/coveoheadless/definitions/utils/fetch-event-source/parse.d.ts +36 -0
- package/force-app/main/default/staticresources/coveoheadless/headless.js +11 -9
- package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +10 -8
- package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +9 -7
- package/package.json +6 -6
- package/force-app/main/default/staticresources/coveoheadless/definitions/tsdoc-metadata.json +0 -11
|
@@ -123,6 +123,12 @@ export interface BaseProduct {
|
|
|
123
123
|
/**
|
|
124
124
|
* The length and offset of each word to highlight in the product excerpt string.
|
|
125
125
|
*/
|
|
126
|
+
excerptHighlights?: HighlightKeyword[];
|
|
127
|
+
/**
|
|
128
|
+
* @deprecated Use `excerptHighlights` instead.
|
|
129
|
+
*
|
|
130
|
+
* The length and offset of each word to highlight in the product excerpt string.
|
|
131
|
+
*/
|
|
126
132
|
excerptsHighlights?: HighlightKeyword[];
|
|
127
133
|
}
|
|
128
134
|
export interface Product extends BaseProduct {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { EventSourceMessage } from '@microsoft/fetch-event-source';
|
|
2
1
|
import { ThunkDispatch, UnknownAction } from '@reduxjs/toolkit';
|
|
3
2
|
import { GeneratedContentFormat } from '../../features/generated-answer/generated-response-format.js';
|
|
4
3
|
import { SearchAppState } from '../../state/search-app-state.js';
|
|
5
4
|
import { ConfigurationSection, GeneratedAnswerSection, InsightConfigurationSection } from '../../state/state-sections.js';
|
|
5
|
+
import { EventSourceMessage } from '../../utils/fetch-event-source/parse.js';
|
|
6
6
|
import { GeneratedAnswerCitation } from '../generated-answer/generated-answer-event-payload.js';
|
|
7
7
|
import { SearchRequest } from '../search/search/search-request.js';
|
|
8
8
|
export type StateNeededByAnswerAPI = {
|
|
@@ -39,6 +39,15 @@ export interface EngineDefinition<TControllers extends ControllerDefinitionsMap<
|
|
|
39
39
|
* Note: The implementation specifics of the navigator context provider depend on the Node.js framework being utilized. It is the developer's responsibility to appropriately define and implement the navigator context provider to ensure accurate navigation context is available throughout the application. If the user fails to provide a navigator context provider, a warning will be logged either on the server or the browser console.
|
|
40
40
|
*/
|
|
41
41
|
setNavigatorContextProvider: (navigatorContextProvider: NavigatorContextProvider) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the access token.
|
|
44
|
+
*/
|
|
45
|
+
getAccessToken: () => string;
|
|
46
|
+
/**
|
|
47
|
+
* Updates the access token.
|
|
48
|
+
* @param accessToken - The access token to update.
|
|
49
|
+
*/
|
|
50
|
+
setAccessToken: (accessToken: string) => void;
|
|
42
51
|
}
|
|
43
52
|
export type InferStaticState<T extends {
|
|
44
53
|
fetchStaticState(...args: unknown[]): Promise<unknown>;
|
|
@@ -41,13 +41,15 @@ export interface CategoryFacetOptions {
|
|
|
41
41
|
/**
|
|
42
42
|
* Whether to exclude the parents of folded results when estimating the result count for each facet value.
|
|
43
43
|
*
|
|
44
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
45
|
+
*
|
|
44
46
|
* @defaultValue `true`
|
|
45
47
|
*/
|
|
46
48
|
filterFacetCount?: boolean;
|
|
47
49
|
/**
|
|
48
50
|
* The maximum number of results to scan in the index to ensure that the facet lists all of the potential facet values.
|
|
49
51
|
*
|
|
50
|
-
*
|
|
52
|
+
* Note: A high `injectionDepth` may reduce facet request performance.
|
|
51
53
|
*
|
|
52
54
|
* Minimum: `0`
|
|
53
55
|
*
|
|
@@ -24,13 +24,15 @@ export interface FacetOptions {
|
|
|
24
24
|
/**
|
|
25
25
|
* Whether to exclude the parents of folded results when estimating the result count for each facet value.
|
|
26
26
|
*
|
|
27
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
28
|
+
*
|
|
27
29
|
* @defaultValue `true`
|
|
28
30
|
*/
|
|
29
31
|
filterFacetCount?: boolean;
|
|
30
32
|
/**
|
|
31
33
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
32
34
|
*
|
|
33
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
35
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
34
36
|
*
|
|
35
37
|
* Minimum: `0`
|
|
36
38
|
*
|
|
@@ -24,13 +24,15 @@ export interface DateFilterOptions {
|
|
|
24
24
|
/**
|
|
25
25
|
* Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
26
26
|
*
|
|
27
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
28
|
+
*
|
|
27
29
|
* @defaultValue `true`
|
|
28
30
|
*/
|
|
29
31
|
filterFacetCount?: boolean;
|
|
30
32
|
/**
|
|
31
33
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
32
34
|
*
|
|
33
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
35
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
34
36
|
*
|
|
35
37
|
* Minimum: `0`
|
|
36
38
|
*
|
|
@@ -38,13 +38,15 @@ export interface DateFacetOptions {
|
|
|
38
38
|
/**
|
|
39
39
|
* Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
40
40
|
*
|
|
41
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
42
|
+
*
|
|
41
43
|
* @defaultValue `true`
|
|
42
44
|
*/
|
|
43
45
|
filterFacetCount?: boolean;
|
|
44
46
|
/**
|
|
45
47
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
46
48
|
*
|
|
47
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
49
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
48
50
|
*
|
|
49
51
|
* Minimum: `0`
|
|
50
52
|
*
|
|
@@ -24,13 +24,15 @@ export interface NumericFilterOptions {
|
|
|
24
24
|
/**
|
|
25
25
|
* Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
26
26
|
*
|
|
27
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
28
|
+
*
|
|
27
29
|
* @defaultValue `true`
|
|
28
30
|
*/
|
|
29
31
|
filterFacetCount?: boolean;
|
|
30
32
|
/**
|
|
31
33
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
32
34
|
*
|
|
33
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
35
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
34
36
|
*
|
|
35
37
|
* Minimum: `0`
|
|
36
38
|
*
|
|
@@ -42,13 +42,15 @@ export interface NumericFacetOptions {
|
|
|
42
42
|
/**
|
|
43
43
|
* Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
44
44
|
*
|
|
45
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
46
|
+
*
|
|
45
47
|
* @defaultValue `true`
|
|
46
48
|
*/
|
|
47
49
|
filterFacetCount?: boolean;
|
|
48
50
|
/**
|
|
49
51
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
50
52
|
*
|
|
51
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
53
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
52
54
|
*
|
|
53
55
|
* Minimum: `0`
|
|
54
56
|
*
|
|
@@ -24,13 +24,15 @@ export interface FacetOptions {
|
|
|
24
24
|
/**
|
|
25
25
|
* Whether to exclude the parents of folded results when estimating the result count for each facet value.
|
|
26
26
|
*
|
|
27
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
28
|
+
*
|
|
27
29
|
* @defaultValue `true`
|
|
28
30
|
*/
|
|
29
31
|
filterFacetCount?: boolean;
|
|
30
32
|
/**
|
|
31
33
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
32
34
|
*
|
|
33
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
35
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
34
36
|
*
|
|
35
37
|
* Minimum: `0`
|
|
36
38
|
*
|
|
@@ -41,13 +41,15 @@ export interface RegisterCategoryFacetActionCreatorPayload {
|
|
|
41
41
|
/**
|
|
42
42
|
* Whether to exclude the parents of folded results when estimating the result count for each facet value.
|
|
43
43
|
*
|
|
44
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
45
|
+
*
|
|
44
46
|
* @defaultValue `true`
|
|
45
47
|
*/
|
|
46
48
|
filterFacetCount?: boolean;
|
|
47
49
|
/**
|
|
48
50
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
49
51
|
*
|
|
50
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
52
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
51
53
|
*
|
|
52
54
|
* Minimum: `0`
|
|
53
55
|
*
|
|
@@ -9,12 +9,15 @@ export interface BaseFacetRequest {
|
|
|
9
9
|
/** The field whose values you want to display in the facet.*/
|
|
10
10
|
field: string;
|
|
11
11
|
/** Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
12
|
+
*
|
|
13
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
14
|
+
*
|
|
12
15
|
* @defaultValue `true`
|
|
13
16
|
*/
|
|
14
17
|
filterFacetCount: boolean;
|
|
15
18
|
/** The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
16
19
|
*
|
|
17
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
20
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
18
21
|
*
|
|
19
22
|
* Minimum: `0`
|
|
20
23
|
*
|
|
@@ -24,13 +24,15 @@ export interface RegisterFacetActionCreatorPayload {
|
|
|
24
24
|
/**
|
|
25
25
|
* Whether to exclude the parents of folded results when estimating the result count for each facet value.
|
|
26
26
|
*
|
|
27
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
28
|
+
*
|
|
27
29
|
* @defaultValue `true`
|
|
28
30
|
*/
|
|
29
31
|
filterFacetCount?: boolean;
|
|
30
32
|
/**
|
|
31
33
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
32
34
|
*
|
|
33
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
35
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
34
36
|
*
|
|
35
37
|
* Minimum: `0`
|
|
36
38
|
*
|
|
@@ -39,13 +39,15 @@ export interface RegisterDateFacetActionCreatorPayload {
|
|
|
39
39
|
/**
|
|
40
40
|
* Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
41
41
|
*
|
|
42
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
43
|
+
*
|
|
42
44
|
* @defaultValue `true`
|
|
43
45
|
*/
|
|
44
46
|
filterFacetCount?: boolean;
|
|
45
47
|
/**
|
|
46
48
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
47
49
|
*
|
|
48
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
50
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
49
51
|
*
|
|
50
52
|
* Minimum: `0`
|
|
51
53
|
*
|
|
@@ -39,13 +39,15 @@ export interface RegisterNumericFacetActionCreatorPayload {
|
|
|
39
39
|
/**
|
|
40
40
|
* Whether to exclude folded result parents when estimating the result count for each facet value.
|
|
41
41
|
*
|
|
42
|
+
* Note: Resulting count is only an estimation, in some cases this value could be incorrect.
|
|
43
|
+
*
|
|
42
44
|
* @defaultValue `true`
|
|
43
45
|
*/
|
|
44
46
|
filterFacetCount?: boolean;
|
|
45
47
|
/**
|
|
46
48
|
* The maximum number of results to scan in the index to ensure that the facet lists all potential facet values.
|
|
47
49
|
*
|
|
48
|
-
* Note: A high injectionDepth may negatively impact the facet request performance.
|
|
50
|
+
* Note: A high `injectionDepth` may negatively impact the facet request performance.
|
|
49
51
|
*
|
|
50
52
|
* Minimum: `0`
|
|
51
53
|
*
|
|
@@ -31,6 +31,7 @@ export declare const updateResponseFormat: import("@reduxjs/toolkit").ActionCrea
|
|
|
31
31
|
export declare const updateAnswerConfigurationId: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: string], string, "knowledge/updateAnswerConfigurationId", never, never>;
|
|
32
32
|
export declare const registerFieldsToIncludeInCitations: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: string[]], string[], "generatedAnswer/registerFieldsToIncludeInCitations", never, never>;
|
|
33
33
|
export declare const setIsAnswerGenerated: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setIsAnswerGenerated", never, never>;
|
|
34
|
+
export declare const setCannotAnswer: import("@reduxjs/toolkit").ActionCreatorWithPreparedPayload<[payload: boolean], boolean, "generatedAnswer/setCannotAnswer", never, never>;
|
|
34
35
|
interface StreamAnswerArgs {
|
|
35
36
|
setAbortControllerRef: (ref: AbortController) => void;
|
|
36
37
|
}
|
|
@@ -78,6 +78,10 @@ export interface GeneratedAnswerState {
|
|
|
78
78
|
* Whether the answer is expanded.
|
|
79
79
|
*/
|
|
80
80
|
expanded: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether an answer cannot be generated after a query is executed.
|
|
83
|
+
*/
|
|
84
|
+
cannotAnswer: boolean;
|
|
81
85
|
/**
|
|
82
86
|
* The answer configuration unique identifier.
|
|
83
87
|
*/
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { EventSourceMessage } from './parse.js';
|
|
2
|
+
export declare const EventStreamContentType = "text/event-stream";
|
|
3
|
+
export interface FetchEventSourceInit extends RequestInit {
|
|
4
|
+
/**
|
|
5
|
+
* The request headers. FetchEventSource only supports the Record<string,string> format.
|
|
6
|
+
*/
|
|
7
|
+
headers?: Record<string, string>;
|
|
8
|
+
/**
|
|
9
|
+
* Called when a response is received. Use this to validate that the response
|
|
10
|
+
* actually matches what you expect (and throw if it doesn't.) If not provided,
|
|
11
|
+
* will default to a basic validation to ensure the content-type is text/event-stream.
|
|
12
|
+
*/
|
|
13
|
+
onopen?: (response: Response) => Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* Called when a message is received. NOTE: Unlike the default browser
|
|
16
|
+
* EventSource.onmessage, this callback is called for _all_ events,
|
|
17
|
+
* even ones with a custom `event` field.
|
|
18
|
+
*/
|
|
19
|
+
onmessage?: (ev: EventSourceMessage) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Called when a response finishes. If you don't expect the server to kill
|
|
22
|
+
* the connection, you can throw an exception here and retry using onerror.
|
|
23
|
+
*/
|
|
24
|
+
onclose?: () => void;
|
|
25
|
+
/**
|
|
26
|
+
* Called when there is any error making the request / processing messages /
|
|
27
|
+
* handling callbacks etc. Use this to control the retry strategy: if the
|
|
28
|
+
* error is fatal, rethrow the error inside the callback to stop the entire
|
|
29
|
+
* operation. Otherwise, you can return an interval (in milliseconds) after
|
|
30
|
+
* which the request will automatically retry (with the last-event-id).
|
|
31
|
+
* If this callback is not specified, or it returns undefined, fetchEventSource
|
|
32
|
+
* will treat every error as retryable and will try again after 1 second.
|
|
33
|
+
*/
|
|
34
|
+
onerror?: (err: unknown) => number | null | undefined | void;
|
|
35
|
+
/**
|
|
36
|
+
* If true, will keep the request open even if the document is hidden.
|
|
37
|
+
* By default, fetchEventSource will close the request and reopen it
|
|
38
|
+
* automatically when the document becomes visible again.
|
|
39
|
+
*/
|
|
40
|
+
openWhenHidden?: boolean;
|
|
41
|
+
/** The Fetch function to use. Defaults to window.fetch */
|
|
42
|
+
fetch?: typeof fetch;
|
|
43
|
+
}
|
|
44
|
+
export declare function fetchEventSource(input: RequestInfo, { signal: inputSignal, headers: inputHeaders, onopen: inputOnOpen, onmessage, onclose, onerror, openWhenHidden, fetch: inputFetch, ...rest }: FetchEventSourceInit): Promise<void>;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents a message sent in an event stream
|
|
3
|
+
* https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#Event_stream_format
|
|
4
|
+
*/
|
|
5
|
+
export interface EventSourceMessage {
|
|
6
|
+
/** The event ID to set the EventSource object's last event ID value. */
|
|
7
|
+
id: string;
|
|
8
|
+
/** A string identifying the type of event described. */
|
|
9
|
+
event: string;
|
|
10
|
+
/** The event data */
|
|
11
|
+
data: string;
|
|
12
|
+
/** The reconnection interval (in milliseconds) to wait before retrying the connection */
|
|
13
|
+
retry?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Converts a ReadableStream into a callback pattern.
|
|
17
|
+
* @param stream The input ReadableStream.
|
|
18
|
+
* @param onChunk A function that will be called on each new byte chunk in the stream.
|
|
19
|
+
* @returns {Promise<void>} A promise that will be resolved when the stream closes.
|
|
20
|
+
*/
|
|
21
|
+
export declare function getBytes(stream: ReadableStream<Uint8Array>, onChunk: (arr: Uint8Array) => void): Promise<void>;
|
|
22
|
+
/**
|
|
23
|
+
* Parses arbitrary byte chunks into EventSource line buffers.
|
|
24
|
+
* Each line should be of the format "field: value" and ends with \r, \n, or \r\n.
|
|
25
|
+
* @param onLine A function that will be called on each new EventSource line.
|
|
26
|
+
* @returns A function that should be called for each incoming byte chunk.
|
|
27
|
+
*/
|
|
28
|
+
export declare function getLines(onLine: (line: Uint8Array, fieldLength: number) => void): (arr: Uint8Array) => void;
|
|
29
|
+
/**
|
|
30
|
+
* Parses line buffers into EventSourceMessages.
|
|
31
|
+
* @param onId A function that will be called on each `id` field.
|
|
32
|
+
* @param onRetry A function that will be called on each `retry` field.
|
|
33
|
+
* @param onMessage A function that will be called on each message.
|
|
34
|
+
* @returns A function that should be called for each incoming line buffer.
|
|
35
|
+
*/
|
|
36
|
+
export declare function getMessages(onId: (id: string) => void, onRetry: (retry: number) => void, onMessage?: (msg: EventSourceMessage) => void): (line: Uint8Array, fieldLength: number) => void;
|