@amplitude/analytics-types
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -56,2 +56,3 @@ import { Plan } from './plan'; | ||
user_agent?: string; | ||
android_app_set_id?: string; | ||
extra?: { | ||
@@ -58,0 +59,0 @@ [key: string]: any; |
import { AmplitudeReturn } from '../amplitude-promise'; | ||
import { NodeOptions } from '../config'; | ||
import { NodeConfig, NodeOptions } from '../config'; | ||
import { CoreClient } from './core-client'; | ||
import { Plugin } from '../plugin'; | ||
export interface NodeClient extends CoreClient { | ||
@@ -14,3 +15,21 @@ /** | ||
init(apiKey: string, options?: NodeOptions): AmplitudeReturn<void>; | ||
/** | ||
* Adds a new plugin. | ||
* | ||
* ```typescript | ||
* const plugin = { | ||
* name: 'my-plugin', | ||
* type: 'enrichment', | ||
* async setup(config: NodeConfig, amplitude: NodeClient) { | ||
* return; | ||
* }, | ||
* async execute(event: Event) { | ||
* return event; | ||
* }, | ||
* }; | ||
* amplitude.add(plugin); | ||
* ``` | ||
*/ | ||
add(plugin: Plugin<NodeClient, NodeConfig>): AmplitudeReturn<void>; | ||
} | ||
//# sourceMappingURL=node-client.d.ts.map |
import { AmplitudeReturn } from '../amplitude-promise'; | ||
import { BrowserOptions, ReactNativeOptions } from '../config'; | ||
import { BrowserConfig, BrowserOptions, ReactNativeConfig, ReactNativeOptions } from '../config'; | ||
import { TransportType } from '../transport'; | ||
import { CoreClient } from './core-client'; | ||
import { Plugin } from '../plugin'; | ||
interface Client extends CoreClient { | ||
@@ -109,2 +110,20 @@ /** | ||
setTransport(transport: TransportType): void; | ||
/** | ||
* Adds a new plugin. | ||
* | ||
* ```typescript | ||
* const plugin = { | ||
* name: 'my-plugin', | ||
* type: 'enrichment', | ||
* async setup(config: BrowserConfig, amplitude: BrowserClient) { | ||
* return; | ||
* }, | ||
* async execute(event: Event) { | ||
* return event; | ||
* }, | ||
* }; | ||
* amplitude.add(plugin); | ||
* ``` | ||
*/ | ||
add(plugin: Plugin<BrowserClient, BrowserConfig>): AmplitudeReturn<void>; | ||
} | ||
@@ -121,4 +140,22 @@ export interface ReactNativeClient extends Client { | ||
init(apiKey: string, userId?: string, options?: ReactNativeOptions): AmplitudeReturn<void>; | ||
/** | ||
* Adds a new plugin. | ||
* | ||
* ```typescript | ||
* const plugin = { | ||
* name: 'my-plugin', | ||
* type: 'enrichment', | ||
* async setup(config: ReactNativeConfig, amplitude: ReactNativeClient) { | ||
* return; | ||
* }, | ||
* async execute(event: Event) { | ||
* return event; | ||
* }, | ||
* }; | ||
* amplitude.add(plugin); | ||
* ``` | ||
*/ | ||
add(plugin: Plugin<ReactNativeClient, ReactNativeConfig>): AmplitudeReturn<void>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=web-client.d.ts.map |
@@ -13,2 +13,3 @@ import { Event } from '../event'; | ||
flushQueueSize: number; | ||
instanceName?: string; | ||
logLevel: LogLevel; | ||
@@ -15,0 +16,0 @@ loggerProvider: Logger; |
@@ -10,2 +10,4 @@ import { TransportType } from '../transport'; | ||
carrier?: boolean; | ||
appSetId?: boolean; | ||
idfv?: boolean; | ||
} | ||
@@ -12,0 +14,0 @@ type HiddenOptions = 'apiKey' | 'lastEventId'; |
@@ -10,22 +10,22 @@ import { Event } from './event'; | ||
} | ||
export interface BeforePlugin<T = CoreClient> { | ||
export interface BeforePlugin<T = CoreClient, U = Config> { | ||
name: string; | ||
type: PluginType.BEFORE; | ||
setup(config: Config, client?: T): Promise<void>; | ||
setup(config: U, client?: T): Promise<void>; | ||
execute(context: Event): Promise<Event | null>; | ||
} | ||
export interface EnrichmentPlugin<T = CoreClient> { | ||
export interface EnrichmentPlugin<T = CoreClient, U = Config> { | ||
name: string; | ||
type: PluginType.ENRICHMENT; | ||
setup(config: Config, client?: T): Promise<void>; | ||
setup(config: U, client?: T): Promise<void>; | ||
execute(context: Event): Promise<Event | null>; | ||
} | ||
export interface DestinationPlugin<T = CoreClient> { | ||
export interface DestinationPlugin<T = CoreClient, U = Config> { | ||
name: string; | ||
type: PluginType.DESTINATION; | ||
setup(config: Config, client?: T): Promise<void>; | ||
setup(config: U, client?: T): Promise<void>; | ||
execute(context: Event): Promise<Result>; | ||
flush?(): Promise<void>; | ||
} | ||
export type Plugin = BeforePlugin | EnrichmentPlugin | DestinationPlugin; | ||
export type Plugin<T = CoreClient, U = Config> = BeforePlugin<T, U> | EnrichmentPlugin<T, U> | DestinationPlugin<T, U>; | ||
//# sourceMappingURL=plugin.d.ts.map |
@@ -56,2 +56,3 @@ import { Plan } from './plan'; | ||
user_agent?: string; | ||
android_app_set_id?: string; | ||
extra?: { | ||
@@ -58,0 +59,0 @@ [key: string]: any; |
import { AmplitudeReturn } from '../amplitude-promise'; | ||
import { NodeOptions } from '../config'; | ||
import { NodeConfig, NodeOptions } from '../config'; | ||
import { CoreClient } from './core-client'; | ||
import { Plugin } from '../plugin'; | ||
export interface NodeClient extends CoreClient { | ||
@@ -14,3 +15,21 @@ /** | ||
init(apiKey: string, options?: NodeOptions): AmplitudeReturn<void>; | ||
/** | ||
* Adds a new plugin. | ||
* | ||
* ```typescript | ||
* const plugin = { | ||
* name: 'my-plugin', | ||
* type: 'enrichment', | ||
* async setup(config: NodeConfig, amplitude: NodeClient) { | ||
* return; | ||
* }, | ||
* async execute(event: Event) { | ||
* return event; | ||
* }, | ||
* }; | ||
* amplitude.add(plugin); | ||
* ``` | ||
*/ | ||
add(plugin: Plugin<NodeClient, NodeConfig>): AmplitudeReturn<void>; | ||
} | ||
//# sourceMappingURL=node-client.d.ts.map |
import { AmplitudeReturn } from '../amplitude-promise'; | ||
import { BrowserOptions, ReactNativeOptions } from '../config'; | ||
import { BrowserConfig, BrowserOptions, ReactNativeConfig, ReactNativeOptions } from '../config'; | ||
import { TransportType } from '../transport'; | ||
import { CoreClient } from './core-client'; | ||
import { Plugin } from '../plugin'; | ||
interface Client extends CoreClient { | ||
@@ -109,2 +110,20 @@ /** | ||
setTransport(transport: TransportType): void; | ||
/** | ||
* Adds a new plugin. | ||
* | ||
* ```typescript | ||
* const plugin = { | ||
* name: 'my-plugin', | ||
* type: 'enrichment', | ||
* async setup(config: BrowserConfig, amplitude: BrowserClient) { | ||
* return; | ||
* }, | ||
* async execute(event: Event) { | ||
* return event; | ||
* }, | ||
* }; | ||
* amplitude.add(plugin); | ||
* ``` | ||
*/ | ||
add(plugin: Plugin<BrowserClient, BrowserConfig>): AmplitudeReturn<void>; | ||
} | ||
@@ -121,4 +140,22 @@ export interface ReactNativeClient extends Client { | ||
init(apiKey: string, userId?: string, options?: ReactNativeOptions): AmplitudeReturn<void>; | ||
/** | ||
* Adds a new plugin. | ||
* | ||
* ```typescript | ||
* const plugin = { | ||
* name: 'my-plugin', | ||
* type: 'enrichment', | ||
* async setup(config: ReactNativeConfig, amplitude: ReactNativeClient) { | ||
* return; | ||
* }, | ||
* async execute(event: Event) { | ||
* return event; | ||
* }, | ||
* }; | ||
* amplitude.add(plugin); | ||
* ``` | ||
*/ | ||
add(plugin: Plugin<ReactNativeClient, ReactNativeConfig>): AmplitudeReturn<void>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=web-client.d.ts.map |
@@ -13,2 +13,3 @@ import { Event } from '../event'; | ||
flushQueueSize: number; | ||
instanceName?: string; | ||
logLevel: LogLevel; | ||
@@ -15,0 +16,0 @@ loggerProvider: Logger; |
@@ -10,2 +10,4 @@ import { TransportType } from '../transport'; | ||
carrier?: boolean; | ||
appSetId?: boolean; | ||
idfv?: boolean; | ||
} | ||
@@ -12,0 +14,0 @@ type HiddenOptions = 'apiKey' | 'lastEventId'; |
@@ -10,22 +10,22 @@ import { Event } from './event'; | ||
} | ||
export interface BeforePlugin<T = CoreClient> { | ||
export interface BeforePlugin<T = CoreClient, U = Config> { | ||
name: string; | ||
type: PluginType.BEFORE; | ||
setup(config: Config, client?: T): Promise<void>; | ||
setup(config: U, client?: T): Promise<void>; | ||
execute(context: Event): Promise<Event | null>; | ||
} | ||
export interface EnrichmentPlugin<T = CoreClient> { | ||
export interface EnrichmentPlugin<T = CoreClient, U = Config> { | ||
name: string; | ||
type: PluginType.ENRICHMENT; | ||
setup(config: Config, client?: T): Promise<void>; | ||
setup(config: U, client?: T): Promise<void>; | ||
execute(context: Event): Promise<Event | null>; | ||
} | ||
export interface DestinationPlugin<T = CoreClient> { | ||
export interface DestinationPlugin<T = CoreClient, U = Config> { | ||
name: string; | ||
type: PluginType.DESTINATION; | ||
setup(config: Config, client?: T): Promise<void>; | ||
setup(config: U, client?: T): Promise<void>; | ||
execute(context: Event): Promise<Result>; | ||
flush?(): Promise<void>; | ||
} | ||
export type Plugin = BeforePlugin | EnrichmentPlugin | DestinationPlugin; | ||
export type Plugin<T = CoreClient, U = Config> = BeforePlugin<T, U> | EnrichmentPlugin<T, U> | DestinationPlugin<T, U>; | ||
//# sourceMappingURL=plugin.d.ts.map |
{ | ||
"name": "@amplitude/analytics-types", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "", | ||
@@ -38,3 +38,3 @@ "author": "Amplitude Inc", | ||
], | ||
"gitHead": "301ba1e94d67ead341bea225189d7794acdd6922" | ||
"gitHead": "01c20d61e8c51b59dc7fdf83d4abd57391aecf71" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
208683
2182