Skip to content

Commit

Permalink
fix(*): remove types for hooks
Browse files Browse the repository at this point in the history
  • Loading branch information
cley44 committed Jul 21, 2023
1 parent bd899cc commit 7a745fb
Show file tree
Hide file tree
Showing 12 changed files with 93 additions and 886 deletions.
2 changes: 1 addition & 1 deletion packages/screeb-sdk-angular-example/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ bootstrapApplication(AppComponent, {
ScreebModule.forRoot({
autoInit: true,
hooks: {
onReady: (payload) => {
onReady: (payload: any) => {
// eslint-disable-next-line no-console
console.log("SDK is ready", payload);
},
Expand Down
68 changes: 34 additions & 34 deletions packages/screeb-sdk-angular/docs/classes/Screeb.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@

#### Parameters

| Name | Type |
| :------- | :-------------------------------- |
| Name | Type |
| :------ | :------ |
| `config` | [`ScreebConfig`](ScreebConfig.md) |

## Properties
Expand Down Expand Up @@ -117,10 +117,10 @@ ___

#### Parameters

| Name | Type | Default value |
| :------------- | :-------- | :------------ |
| `functionName` | `string` | `undefined` |
| `onlyLoaded` | `boolean` | `false` |
| Name | Type | Default value |
| :------ | :------ | :------ |
| `functionName` | `string` | `undefined` |
| `onlyLoaded` | `boolean` | `false` |

#### Returns

Expand Down Expand Up @@ -155,9 +155,9 @@ this.screeb.eventTrack(

#### Parameters

| Name | Type | Description |
| :----------------- | :--------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `eventName` | `string` | The event name. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `eventName` | `string` | The event name. |
| `eventProperties?` | `PropertyRecord` | The properties of your event. ```text Requirements: - Property names must be limited to 128 characters - No more than 1000 attributes - Supported types for values: string, number, boolean and Date. ``` |

#### Returns
Expand Down Expand Up @@ -190,9 +190,9 @@ this.screeb.identity(

#### Parameters

| Name | Type | Description |
| :---------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `userId` | `string` | The unique identifier of your user. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `userId` | `string` | The unique identifier of your user. |
| `userProperties?` | `PropertyRecord` | The properties of your user. ```text Requirements: - Property names must be limited to 128 characters - No more than 1000 attributes - Supported types for values: string, number, boolean and Date. ``` |

#### Returns
Expand All @@ -212,13 +212,13 @@ Retrieves the current user identity.
```ts
console.log(await this.screeb.identityGet());
// {
// channel_id: "<UUID>",
// anonymous_id: "<UUID>",
// user_id: "<UUID>",
// is_ready: true,
// session_id: "<UUID>",
// session_start: "2023-05-04T16:30:15.882Z",
// session_end: "2023-05-04T17:02:09.087Z",
// channel_id: "<UUID>",
// is_ready: true,
// }
```

Expand Down Expand Up @@ -253,10 +253,10 @@ this.screeb.identityGroupAssign(

#### Parameters

| Name | Type | Description |
| :----------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `groupName` | `string` | |
| `groupType?` | `string` | |
| Name | Type | Description |
| :------ | :------ | :------ |
| `groupName` | `string` | |
| `groupType?` | `string` | |
| `groupProperties?` | `PropertyRecord` | The properties of your user group. ```text Requirements: - Property names must be limited to 128 characters - No more than 1000 attributes - Supported types for values: string, number, boolean and Date. ``` |

#### Returns
Expand All @@ -279,9 +279,9 @@ this.screeb.identityGroupUnassign('company', 'Apple');

#### Parameters

| Name | Type | Description |
| :----------- | :------- | :--------------------------- |
| `groupName` | `string` | The name of your user group. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `groupName` | `string` | The name of your user group. |
| `groupType?` | `string` | The type of your user group. |

#### Returns
Expand Down Expand Up @@ -322,8 +322,8 @@ this.screeb.identityProperties(

#### Parameters

| Name | Type | Description |
| :--------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Name | Type | Description |
| :------ | :------ | :------ |
| `userProperties` | `PropertyRecord` | The properties of your user. ```text Requirements: - Property names must be limited to 128 characters - No more than 1000 attributes - Supported types for values: string, number, boolean and Date. ``` |

#### Returns
Expand Down Expand Up @@ -380,12 +380,12 @@ this.screeb.init(

#### Parameters

| Name | Type | Description |
| :---------------- | :--------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `websiteId` | `string` | Your website/channel id. |
| `userId?` | `string` | The unique identifier of your user. |
| Name | Type | Description |
| :------ | :------ | :------ |
| `websiteId` | `string` | Your website/channel id. |
| `userId?` | `string` | The unique identifier of your user. |
| `userProperties?` | `PropertyRecord` | The properties of your user. ```text Requirements: - Property names must be limited to 128 characters - No more than 1000 attributes - Supported types for values: string, number, boolean and Date ``` |
| `hooks?` | `GlobalHooks` | - |
| `hooks?` | `any` | - |

#### Returns

Expand Down Expand Up @@ -455,12 +455,12 @@ this.screeb.surveyStart(

#### Parameters

| Name | Type |
| :----------------------- | :--------------- |
| `surveyId` | `string` |
| `allowMultipleResponses` | `boolean` |
| `hiddenFields` | `PropertyRecord` |
| `hooks?` | `SurveyHooks` |
| Name | Type |
| :------ | :------ |
| `surveyId` | `string` |
| `allowMultipleResponses` | `boolean` |
| `hiddenFields` | `PropertyRecord` |
| `hooks?` | `any` |

#### Returns

Expand Down
2 changes: 1 addition & 1 deletion packages/screeb-sdk-angular/docs/classes/ScreebConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ___

### hooks

`Optional` **hooks**: `GlobalHooks`
`Optional` **hooks**: `any`

Hooks to define callback for various event

Expand Down
10 changes: 5 additions & 5 deletions packages/screeb-sdk-angular/docs/classes/ScreebModule.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

#### Parameters

| Name | Type |
| :------- | :-------------------------------- |
| Name | Type |
| :------ | :------ |
| `config` | [`ScreebConfig`](ScreebConfig.md) |
| `screeb` | [`Screeb`](Screeb.md) |
| `screeb` | [`Screeb`](Screeb.md) |

## Methods

Expand Down Expand Up @@ -57,8 +57,8 @@ ScreebModule.forRoot({

#### Parameters

| Name | Type | Description |
| :------- | :-------------------------------- | :------------------------------------------ |
| Name | Type | Description |
| :------ | :------ | :------ |
| `config` | [`ScreebConfig`](ScreebConfig.md) | Configuration to pass to Screeb browser SDK |

#### Returns
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { Injectable } from "@angular/core";
import {
GlobalHooks,
PropertyRecord,
ScreebOptions,
} from "@screeb/sdk-browser";
import { PropertyRecord, ScreebOptions } from "@screeb/sdk-browser";

/** Configuration of Screeb module */
@Injectable({ providedIn: "root" })
Expand All @@ -15,7 +11,7 @@ export class ScreebConfig {
/** The properties of your user. */
userProperties?: PropertyRecord;
/** Hooks to define callback for various event */
hooks?: GlobalHooks;
hooks?: any;
/**
* Indicates if Screeb should be automatically loaded.
* This will ping to the Screeb servers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ export class Screeb {
surveyId: string,
allowMultipleResponses: boolean,
hiddenFields: _Screeb.PropertyRecord,
hooks?: _Screeb.SurveyHooks
hooks?: any
) {
await this.ensureScreeb("surveyStart");

Expand Down Expand Up @@ -412,7 +412,7 @@ export class Screeb {
websiteId: string,
userId?: string,
userProperties?: _Screeb.PropertyRecord,
hooks?: _Screeb.GlobalHooks
hooks?: any
) {
await this.ensureScreeb("init", true);

Expand Down
Loading

0 comments on commit 7a745fb

Please sign in to comment.