Skip to content

Commit

Permalink
feat: add UserParams type in export
Browse files Browse the repository at this point in the history
  • Loading branch information
NikitaCG committed Nov 14, 2023
1 parent add45c1 commit 284ad8f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,10 @@ app.get((req, res) => {
Plugin options:

```typescript
export type UserParams = {
[x: string]: boolean | string | number | null | UserParams;
};

export interface MetrikaCounter {
id: number;
defer: boolean;
Expand All @@ -359,9 +363,7 @@ export interface MetrikaCounter {
trackHash?: boolean;
ecommerce?: boolean | string;
type?: number;
userParams?: {
[x: string]: boolean | string | number;
};
userParams?: UserParams;
}

export type MetrikaOptions = {
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ export type {
RenderParams,
} from './types.js';

export type {MetrikaCounter, MetrikaPluginOptions} from './plugins/yandex-metrika/index.js';
export type {
MetrikaCounter,
MetrikaPluginOptions,
UserParams,
} from './plugins/yandex-metrika/index.js';
export type {
GoogleAnalyticsCounter,
GoogleAnalyticsPluginOptions,
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yandex-metrika/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type {Plugin, RenderHelpers} from '../../types.js';
import type {MetrikaCounter, MetrikaPluginOptions} from './types.js';

export type {MetrikaCounter, MetrikaPluginOptions} from './types.js';
export type {MetrikaCounter, MetrikaPluginOptions, UserParams} from './types.js';

export function createYandexMetrikaPlugin(): Plugin<MetrikaPluginOptions, 'yandexMetrika'> {
return {
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/yandex-metrika/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
type UserParams = {
export type UserParams = {
[x: string]: boolean | string | number | null | UserParams;
};

Expand Down

0 comments on commit 284ad8f

Please sign in to comment.