@dynatrace/dtrum-api-types 1.305.2 → 1.309.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +1 -0
- package/README.md +44 -44
- package/dtrum.d.ts +3 -4
- package/package.json +18 -18
package/LICENSE.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Copyright (c) Dynatrace LLC. All rights reserved.
|
package/README.md
CHANGED
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
# Dynatrace Dtrum Api Types
|
|
2
|
-
This package contains the Typescript type information for the
|
|
3
|
-
|
|
4
|
-
Keep in mind that when the
|
|
5
|
-
Version: 1.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
> npm install --save-dev @dynatrace/dtrum-api-types
|
|
9
|
-
|
|
10
|
-
## Configuration
|
|
11
|
-
Make sure to add these paths to `"typeRoots"` in tsconfig.json under `"compilerOptions"`
|
|
12
|
-
```
|
|
13
|
-
"typeRoots": ["./node_modules/@types", "./node_modules/@dynatrace/"],
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
## Usage examples
|
|
17
|
-
Type inference works out of the box for dtrum calls.
|
|
18
|
-
```
|
|
19
|
-
if (window.dtrum) {
|
|
20
|
-
window.dtrum.identifyUser("exampleId");
|
|
21
|
-
} else {
|
|
22
|
-
// handle missing dtrum api
|
|
23
|
-
}
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
In case some specific types or enums are needed, you can import them from `dtrum` types library.
|
|
27
|
-
```
|
|
28
|
-
import { ActionNameResult } from '@dynatrace/dtrum-api-types';
|
|
29
|
-
|
|
30
|
-
if (window.dtrum) {
|
|
31
|
-
const result = window.dtrum.actionName("exampleName");
|
|
32
|
-
switch(result) {
|
|
33
|
-
case ActionNameResult.SUCCESS:
|
|
34
|
-
// handle success...
|
|
35
|
-
break;
|
|
36
|
-
case ActionNameResult.ACTION_NOT_FOUND:
|
|
37
|
-
// handle action not found...
|
|
38
|
-
break;
|
|
39
|
-
//etc...
|
|
40
|
-
}
|
|
41
|
-
} else {
|
|
42
|
-
// handle missing dtrum api
|
|
43
|
-
}
|
|
44
|
-
```
|
|
1
|
+
# Dynatrace Dtrum Api Types
|
|
2
|
+
This package contains the Typescript type information for the dtrum.* API of the RUM JavaScript.
|
|
3
|
+
|
|
4
|
+
Keep in mind that when the RUM JavaScript is updated, this type package might not provide accurate types.
|
|
5
|
+
Version: 1.309.4
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
> npm install --save-dev @dynatrace/dtrum-api-types
|
|
9
|
+
|
|
10
|
+
## Configuration
|
|
11
|
+
Make sure to add these paths to `"typeRoots"` in tsconfig.json under `"compilerOptions"`
|
|
12
|
+
```
|
|
13
|
+
"typeRoots": ["./node_modules/@types", "./node_modules/@dynatrace/"],
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Usage examples
|
|
17
|
+
Type inference works out of the box for dtrum calls.
|
|
18
|
+
```
|
|
19
|
+
if (window.dtrum) {
|
|
20
|
+
window.dtrum.identifyUser("exampleId");
|
|
21
|
+
} else {
|
|
22
|
+
// handle missing dtrum api
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
In case some specific types or enums are needed, you can import them from `dtrum` types library.
|
|
27
|
+
```
|
|
28
|
+
import { ActionNameResult } from '@dynatrace/dtrum-api-types';
|
|
29
|
+
|
|
30
|
+
if (window.dtrum) {
|
|
31
|
+
const result = window.dtrum.actionName("exampleName");
|
|
32
|
+
switch(result) {
|
|
33
|
+
case ActionNameResult.SUCCESS:
|
|
34
|
+
// handle success...
|
|
35
|
+
break;
|
|
36
|
+
case ActionNameResult.ACTION_NOT_FOUND:
|
|
37
|
+
// handle action not found...
|
|
38
|
+
break;
|
|
39
|
+
//etc...
|
|
40
|
+
}
|
|
41
|
+
} else {
|
|
42
|
+
// handle missing dtrum api
|
|
43
|
+
}
|
|
44
|
+
```
|
package/dtrum.d.ts
CHANGED
|
@@ -141,7 +141,6 @@ export interface MetaData {
|
|
|
141
141
|
info?: string;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
145
144
|
export interface DtrumApi {
|
|
146
145
|
/**
|
|
147
146
|
* Enables/disables automatic action detection. Use when you want to instrument your application only manually.
|
|
@@ -530,9 +529,9 @@ export interface DtrumApi {
|
|
|
530
529
|
* @param key The key of the error. For example, 'validation error'
|
|
531
530
|
* @param value The error value. For example, 'Email validation failed'
|
|
532
531
|
* @param hint A hint to pinpoint the problem, e.g. content of the input element which triggered the failed validation
|
|
533
|
-
* @param parentingInfo How the custom error should be attached (default = false)
|
|
534
|
-
*
|
|
535
|
-
*
|
|
532
|
+
* @param parentingInfo How the custom error should be attached (default = false).
|
|
533
|
+
* When providing a number: To which open action the custom error event should be attached.
|
|
534
|
+
* When providing a boolean: If true it will get attached to the current active action
|
|
536
535
|
*/
|
|
537
536
|
reportCustomError(key: string, value: string, hint?: string, parentingInfo?: number | boolean): void;
|
|
538
537
|
|
package/package.json
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dynatrace/dtrum-api-types",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Typescript types for Dynatrace
|
|
5
|
-
"main": "",
|
|
6
|
-
"typings": "dtrum.d.ts",
|
|
7
|
-
"homepage": "https://www.dynatrace.com",
|
|
8
|
-
"author": "Dynatrace",
|
|
9
|
-
"license": "
|
|
10
|
-
"keywords": [
|
|
11
|
-
"dynatrace",
|
|
12
|
-
"jsagent",
|
|
13
|
-
"dtrum",
|
|
14
|
-
"api",
|
|
15
|
-
"typescript",
|
|
16
|
-
"types"
|
|
17
|
-
]
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dynatrace/dtrum-api-types",
|
|
3
|
+
"version": "1.309.4",
|
|
4
|
+
"description": "Typescript types for the Dynatrace RUM JavaScript dtrum.* API",
|
|
5
|
+
"main": "",
|
|
6
|
+
"typings": "dtrum.d.ts",
|
|
7
|
+
"homepage": "https://www.dynatrace.com",
|
|
8
|
+
"author": "Dynatrace",
|
|
9
|
+
"license": "SEE LICENSE IN LICENSE.md",
|
|
10
|
+
"keywords": [
|
|
11
|
+
"dynatrace",
|
|
12
|
+
"jsagent",
|
|
13
|
+
"dtrum",
|
|
14
|
+
"api",
|
|
15
|
+
"typescript",
|
|
16
|
+
"types"
|
|
17
|
+
]
|
|
18
|
+
}
|