-
Notifications
You must be signed in to change notification settings - Fork 565
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Types: Add random types to various files (#1933)
- Loading branch information
Showing
13 changed files
with
185 additions
and
131 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import * as T from '../types'; | ||
|
||
export type TKQItem = | ||
| Function | ||
| [keyof TracksAPI, ...(string | T.JSONSerializable)[]]; | ||
|
||
export type TracksAPI = { | ||
storeContext: (c: object) => void; | ||
identifyUser: (user: string, login: string) => void; | ||
recordEvent: (name: string, props: T.JSONSerializable) => void; | ||
setProperties: (properties: object) => void; | ||
clearIdentity: () => void; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
declare var __TEST__: boolean; | ||
import { TKQItem, TracksAPI } from './analytics/types'; | ||
|
||
interface Window { | ||
_tkq: Array; | ||
testEvents: (string | [string, ...any[]])[]; | ||
wpcom: { | ||
tracks: object; | ||
}; | ||
declare global { | ||
const __TEST__: boolean; | ||
|
||
interface Window { | ||
analyticsEnabled: boolean; | ||
testEvents: (string | [string, ...any[]])[]; | ||
_tkq: TKQItem[] & { a: unknown }; | ||
wpcom: { | ||
tracks: TracksAPI; | ||
}; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.