Skip to content

Commit

Permalink
Add types to package.json (#58420)
Browse files Browse the repository at this point in the history
  • Loading branch information
janicklas-ralph authored Nov 15, 2023
1 parent f99242b commit 280b9f9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
1 change: 1 addition & 0 deletions packages/third-parties/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"exports": {
"./google": "./dist/google/index.js"
},
"types": "dist/types/google.d.ts",
"files": [
"dist"
],
Expand Down
15 changes: 1 addition & 14 deletions packages/third-parties/src/google/gtm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,7 @@
import React from 'react'
import Script from 'next/script'

declare global {
interface Window {
dataLayer?: Object[]
[key: string]: any
}
}

type GTMParams = {
gtmId: string
dataLayer?: string[]
dataLayerName?: string
auth?: string
preview?: string
}
import type { GTMParams } from '../types/google'

let currDataLayerName: string | undefined = undefined

Expand Down
15 changes: 15 additions & 0 deletions packages/third-parties/src/types/google.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
declare global {
interface Window {
dataLayer?: Object[]
[key: string]: any
}
}

export type GTMParams = {
gtmId: string
dataLayer?: string[]
dataLayerName?: string
auth?: string
preview?: string
}

export type GoogleMapsEmbed = {
height?: number
width?: number
Expand Down

0 comments on commit 280b9f9

Please sign in to comment.