@types/segment-analytics
Advanced tools
Comparing version 0.0.31 to 0.0.32
// Type definitions for Segment's analytics.js | ||
// Project: https://segment.com/docs/libraries/analytics.js/ | ||
// Definitions by: Andrew Fong <https://github.com/fongandrew> | ||
// Miroslav Petrik <https://github.com/MiroslavPetrik> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -18,5 +19,71 @@ // TypeScript Version: 2.3 | ||
interface CookieOptions { | ||
maxage?: number; | ||
domain?: string; | ||
path?: string; | ||
secure?: boolean; | ||
} | ||
interface MetricsOptions { | ||
host?: string; | ||
sampleRate?: number; | ||
flushTimer?: number; | ||
maxQueueSize?: number; | ||
} | ||
interface StoreOptions { | ||
enabled?: boolean; | ||
} | ||
interface UserOptions { | ||
cookie?: { | ||
key: string; | ||
oldKey: string; | ||
}; | ||
localStorage?: { | ||
key: string; | ||
}; | ||
persist?: boolean; | ||
} | ||
interface GroupOptions { | ||
cookie?: { | ||
key: string; | ||
}; | ||
localStorage?: { | ||
key: string; | ||
}; | ||
persist?: boolean; | ||
} | ||
interface InitOptions { | ||
cookie?: CookieOptions; | ||
metrics?: MetricsOptions; | ||
localStorage?: StoreOptions; | ||
user?: UserOptions; | ||
group?: GroupOptions; | ||
integrations?: { | ||
All?: boolean; | ||
[integration: string]: boolean | undefined; | ||
}; | ||
} | ||
interface IntegrationsSettings { | ||
[key: string]: any; | ||
} | ||
// The actual analytics.js object | ||
interface AnalyticsJS { | ||
/* Use a plugin */ | ||
use(plugin: (analytics: AnalyticsJS) => void): this; | ||
/* Initialize with the given integration `settings` and `options`. */ | ||
init(settings?: IntegrationsSettings, options?: InitOptions): this; | ||
/* Define a new integration */ | ||
addIntegration(integration: (options: any) => void): this; | ||
/* Set the user's `id`. */ | ||
setAnonymousId(id: string): this; | ||
/* Configure Segment with write key */ | ||
@@ -144,1 +211,6 @@ load(writeKey: string): void; | ||
declare var analytics: SegmentAnalytics.AnalyticsJS; | ||
declare module '@segment/analytics.js-core' { | ||
var analytics: SegmentAnalytics.AnalyticsJS; | ||
export default analytics; | ||
} |
{ | ||
"name": "@types/segment-analytics", | ||
"version": "0.0.31", | ||
"version": "0.0.32", | ||
"description": "TypeScript definitions for Segment's analytics.js", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "fongandrew" | ||
}, | ||
{ | ||
"name": "Miroslav Petrik", | ||
"url": "https://github.com/MiroslavPetrik", | ||
"githubUsername": "MiroslavPetrik" | ||
} | ||
@@ -23,4 +28,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "7f7bc0e469ac8f9b07e7d0f548a5ba0e5e40b17a1c3d913d201aa1841ef0c84f", | ||
"typesPublisherContentHash": "8f397ff30dd4bd1911c9cc8a13bb2161865a073ad5708949432360f662b878f1", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for Segment's analytics.js ( https://segment.com/docs/libraries/analytics.js/ ). | ||
This package contains type definitions for Segment's analytics.js (https://segment.com/docs/libraries/analytics.js/). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Sun, 16 Jun 2019 06:33:23 GMT | ||
* Last updated: Fri, 02 Aug 2019 21:04:31 GMT | ||
* Dependencies: none | ||
@@ -18,2 +18,2 @@ * Global values: analytics | ||
# Credits | ||
These definitions were written by Andrew Fong <https://github.com/fongandrew>. | ||
These definitions were written by Andrew Fong <https://github.com/fongandrew>, and Miroslav Petrik <https://github.com/MiroslavPetrik>. |
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
10291
180