diff --git a/src/index.js b/src/index.js index d4586c2..89f0d53 100644 --- a/src/index.js +++ b/src/index.js @@ -1,12 +1,12 @@ /** - * @typedef {import("../types/interfaces/edgee-components-data-collection").EdgeeComponentsDataCollection} EdgeeComponentsDataCollection - * @typedef {import("../types/interfaces/edgee-components-data-collection").EdgeeRequest} EdgeeRequest - * @typedef {import("../types/interfaces/edgee-components-data-collection").Dict} Dict - * @typedef {import("../types/interfaces/edgee-components-data-collection").Event} Event - * @typedef {import("../types/interfaces/edgee-components-data-collection").PageData} PageData - * @typedef {import("../types/interfaces/edgee-components-data-collection").TrackData} TrackData - * @typedef {import("../types/interfaces/edgee-components-data-collection").UserData} UserData - * @typedef {import("../types/interfaces/edgee-components-data-collection").Context} Context + * @typedef {import("../types/wit").dataCollection} EdgeeDataCollection + * @typedef {import("../types/wit").dataCollection.EdgeeRequest} EdgeeRequest + * @typedef {import("../types/wit").dataCollection.Dict} Dict + * @typedef {import("../types/wit").dataCollection.Event} Event + * @typedef {import("../types/wit").dataCollection.PageData} PageData + * @typedef {import("../types/wit").dataCollection.TrackData} TrackData + * @typedef {import("../types/wit").dataCollection.UserData} UserData + * @typedef {import("../types/wit").dataCollection.Context} Context */ const API_ENDPOINT = "https://your-endpoint.com/path"; @@ -97,11 +97,11 @@ const buildUserPayload = (data, context) => { }; }; -/** @type {EdgeeComponentsDataCollection} */ +/** @type {EdgeeDataCollection} */ export const dataCollection = { /** - * @param {Event} e + * @param {dataCollection.Event} e * @param {Dict} settings */ page(e, settings) { diff --git a/types/interfaces/edgee-components-data-collection.d.ts b/types/interfaces/edgee-components-data-collection.d.ts index 6e77831..ad32d3b 100644 --- a/types/interfaces/edgee-components-data-collection.d.ts +++ b/types/interfaces/edgee-components-data-collection.d.ts @@ -1,8 +1,7 @@ -export namespace EdgeeComponentsDataCollection { - export function page(e: Event, settings: Dict): EdgeeRequest; - export function track(e: Event, settings: Dict): EdgeeRequest; - export function user(e: Event, settings: Dict): EdgeeRequest; -} +/** @module Interface edgee:components/data-collection **/ +export function page(e: Event, settings: Dict): EdgeeRequest; +export function track(e: Event, settings: Dict): EdgeeRequest; +export function user(e: Event, settings: Dict): EdgeeRequest; export type Dict = Array<[string, string]>; /** * # Variants diff --git a/types/wit.d.ts b/types/wit.d.ts index 821b714..3a8b423 100644 --- a/types/wit.d.ts +++ b/types/wit.d.ts @@ -1,2 +1,2 @@ -import { EdgeeComponentsDataCollection } from './interfaces/edgee-components-data-collection.js'; -export const dataCollection: typeof EdgeeComponentsDataCollection; +// world edgee:native/data-collection +export * as dataCollection from './interfaces/edgee-components-data-collection.js'; // export edgee:components/data-collection