dreaction-protocol 1.0.8 → 1.0.10
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/lib/command.d.ts +35 -72
- package/lib/command.d.ts.map +1 -1
- package/lib/command.js +0 -37
- package/lib/customCommand.d.ts +4 -0
- package/lib/customCommand.d.ts.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/issue.d.ts +6 -0
- package/lib/issue.d.ts.map +1 -0
- package/lib/issue.js +2 -0
- package/package.json +1 -1
- package/src/command.ts +36 -75
- package/src/customCommand.ts +1 -0
- package/src/index.ts +1 -0
- package/src/issue.ts +5 -0
package/lib/command.d.ts
CHANGED
|
@@ -1,87 +1,50 @@
|
|
|
1
1
|
import { AsyncStorageMutationState } from './asyncStorage';
|
|
2
2
|
import { CustomCommandRegisterPayload, CustomCommandResponsePayload } from './customCommand';
|
|
3
3
|
import { DataWatchPayload } from './data';
|
|
4
|
+
import { ReportIssuePayload } from './issue';
|
|
4
5
|
import type { LogPayload } from './log';
|
|
5
6
|
import { NetworkPayload } from './network';
|
|
6
7
|
import { EditorOpenPayload } from './openInEditor';
|
|
7
8
|
import { ProfilerFPSPayload, ProfilerRenderPayload } from './profiler';
|
|
8
9
|
import type { StateActionCompletePayload, StateActionDispatchPayload, StateBackupRequestPayload, StateBackupResponsePayload, StateKeysRequestPayload, StateKeysResponsePayload, StateRestoreRequestPayload, StateValuesChangePayload, StateValuesRequestPayload, StateValuesResponsePayload, StateValuesSubscribePayload } from './state';
|
|
9
|
-
export declare const CommandType: {
|
|
10
|
-
readonly ApiResponse: "api.response";
|
|
11
|
-
readonly AsyncStorageMutation: "asyncStorage.mutation";
|
|
12
|
-
readonly Benchmark: "benchmark.report";
|
|
13
|
-
readonly ClientIntro: "client.intro";
|
|
14
|
-
readonly Display: "display";
|
|
15
|
-
readonly Image: "image";
|
|
16
|
-
readonly Log: "log";
|
|
17
|
-
readonly DataWatch: "dataWatch";
|
|
18
|
-
readonly ProfilerRender: "profiler.render";
|
|
19
|
-
readonly ProfilerFPS: "profiler.fps";
|
|
20
|
-
readonly SagaTaskComplete: "saga.task.complete";
|
|
21
|
-
readonly StateActionComplete: "state.action.complete";
|
|
22
|
-
readonly StateKeysResponse: "state.keys.response";
|
|
23
|
-
readonly StateValuesChange: "state.values.change";
|
|
24
|
-
readonly StateValuesResponse: "state.values.response";
|
|
25
|
-
readonly StateBackupResponse: "state.backup.response";
|
|
26
|
-
readonly StateBackupRequest: "state.backup.request";
|
|
27
|
-
readonly StateRestoreRequest: "state.restore.request";
|
|
28
|
-
readonly StateActionDispatch: "state.action.dispatch";
|
|
29
|
-
readonly StateValuesSubscribe: "state.values.subscribe";
|
|
30
|
-
readonly StateKeysRequest: "state.keys.request";
|
|
31
|
-
readonly StateValuesRequest: "state.values.request";
|
|
32
|
-
readonly CustomCommandRegister: "customCommand.register";
|
|
33
|
-
readonly CustomCommandUnregister: "customCommand.unregister";
|
|
34
|
-
readonly CustomCommandResponse: "customCommand.response";
|
|
35
|
-
readonly Clear: "clear";
|
|
36
|
-
readonly ReplLsResponse: "repl.ls.response";
|
|
37
|
-
readonly ReplExecuteResponse: "repl.execute.response";
|
|
38
|
-
readonly DevtoolsOpen: "devtools.open";
|
|
39
|
-
readonly DevtoolsReload: "devtools.reload";
|
|
40
|
-
readonly EditorOpen: "editor.open";
|
|
41
|
-
readonly Storybook: "storybook";
|
|
42
|
-
readonly Overlay: "overlay";
|
|
43
|
-
};
|
|
44
|
-
export type CommandTypeKey = (typeof CommandType)[keyof typeof CommandType];
|
|
45
10
|
export interface CommandMap {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
[CommandType.EditorOpen]: EditorOpenPayload;
|
|
77
|
-
[CommandType.Storybook]: boolean;
|
|
78
|
-
[CommandType.Overlay]: boolean;
|
|
11
|
+
'api.response': NetworkPayload;
|
|
12
|
+
'asyncStorage.mutation': AsyncStorageMutationState;
|
|
13
|
+
'benchmark.report': any;
|
|
14
|
+
'client.intro': any;
|
|
15
|
+
display: any;
|
|
16
|
+
image: any;
|
|
17
|
+
log: LogPayload;
|
|
18
|
+
dataWatch: DataWatchPayload;
|
|
19
|
+
'profiler.render': ProfilerRenderPayload;
|
|
20
|
+
'profiler.fps': ProfilerFPSPayload;
|
|
21
|
+
'state.action.complete': StateActionCompletePayload;
|
|
22
|
+
'state.keys.response': StateKeysResponsePayload;
|
|
23
|
+
'state.values.change': StateValuesChangePayload;
|
|
24
|
+
'state.values.response': StateValuesResponsePayload;
|
|
25
|
+
'state.backup.response': StateBackupResponsePayload;
|
|
26
|
+
'state.backup.request': StateBackupRequestPayload;
|
|
27
|
+
'state.restore.request': StateRestoreRequestPayload;
|
|
28
|
+
'state.action.dispatch': StateActionDispatchPayload;
|
|
29
|
+
'state.values.subscribe': StateValuesSubscribePayload;
|
|
30
|
+
'state.keys.request': StateKeysRequestPayload;
|
|
31
|
+
'state.values.request': StateValuesRequestPayload;
|
|
32
|
+
'customCommand.register': CustomCommandRegisterPayload;
|
|
33
|
+
'customCommand.unregister': any;
|
|
34
|
+
'customCommand.response': CustomCommandResponsePayload;
|
|
35
|
+
clear: undefined;
|
|
36
|
+
'devtools.open': undefined;
|
|
37
|
+
'devtools.reload': undefined;
|
|
38
|
+
'editor.open': EditorOpenPayload;
|
|
39
|
+
overlay: boolean;
|
|
40
|
+
'report.issue': ReportIssuePayload;
|
|
79
41
|
}
|
|
42
|
+
export type CommandTypeKey = keyof CommandMap;
|
|
80
43
|
export type Command = {
|
|
81
|
-
[Type in
|
|
82
|
-
}[
|
|
44
|
+
[Type in CommandTypeKey]: CommandInferType<Type>;
|
|
45
|
+
}[CommandTypeKey];
|
|
83
46
|
export type CommandEvent = (command: Command) => void;
|
|
84
|
-
export type CommandInferType<T extends
|
|
47
|
+
export type CommandInferType<T extends CommandTypeKey> = {
|
|
85
48
|
type: T;
|
|
86
49
|
connectionId: number;
|
|
87
50
|
clientId?: string;
|
package/lib/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,
|
|
1
|
+
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../src/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EACL,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC1C,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACvE,OAAO,KAAK,EACV,0BAA0B,EAC1B,0BAA0B,EAC1B,yBAAyB,EACzB,0BAA0B,EAC1B,uBAAuB,EACvB,wBAAwB,EACxB,0BAA0B,EAC1B,wBAAwB,EACxB,yBAAyB,EACzB,0BAA0B,EAC1B,2BAA2B,EAC5B,MAAM,SAAS,CAAC;AAEjB,MAAM,WAAW,UAAU;IACzB,cAAc,EAAE,cAAc,CAAC;IAC/B,uBAAuB,EAAE,yBAAyB,CAAC;IACnD,kBAAkB,EAAE,GAAG,CAAC;IACxB,cAAc,EAAE,GAAG,CAAC;IACpB,OAAO,EAAE,GAAG,CAAC;IACb,KAAK,EAAE,GAAG,CAAC;IACX,GAAG,EAAE,UAAU,CAAC;IAChB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,iBAAiB,EAAE,qBAAqB,CAAC;IACzC,cAAc,EAAE,kBAAkB,CAAC;IACnC,uBAAuB,EAAE,0BAA0B,CAAC;IACpD,qBAAqB,EAAE,wBAAwB,CAAC;IAChD,qBAAqB,EAAE,wBAAwB,CAAC;IAChD,uBAAuB,EAAE,0BAA0B,CAAC;IACpD,uBAAuB,EAAE,0BAA0B,CAAC;IACpD,sBAAsB,EAAE,yBAAyB,CAAC;IAClD,uBAAuB,EAAE,0BAA0B,CAAC;IACpD,uBAAuB,EAAE,0BAA0B,CAAC;IACpD,wBAAwB,EAAE,2BAA2B,CAAC;IACtD,oBAAoB,EAAE,uBAAuB,CAAC;IAC9C,sBAAsB,EAAE,yBAAyB,CAAC;IAClD,wBAAwB,EAAE,4BAA4B,CAAC;IACvD,0BAA0B,EAAE,GAAG,CAAC;IAChC,wBAAwB,EAAE,4BAA4B,CAAC;IACvD,KAAK,EAAE,SAAS,CAAC;IACjB,eAAe,EAAE,SAAS,CAAC;IAC3B,iBAAiB,EAAE,SAAS,CAAC;IAC7B,aAAa,EAAE,iBAAiB,CAAC;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,kBAAkB,CAAC;CACpC;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,UAAU,CAAC;AAE9C,MAAM,MAAM,OAAO,GAAG;KACnB,IAAI,IAAI,cAAc,GAAG,gBAAgB,CAAC,IAAI,CAAC;CACjD,CAAC,cAAc,CAAC,CAAC;AAElB,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;AAEtD,MAAM,MAAM,gBAAgB,CAAC,CAAC,SAAS,cAAc,IAAI;IACvD,IAAI,EAAE,CAAC,CAAC;IACR,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,IAAI,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,OAAO,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;CACxB,CAAC"}
|
package/lib/command.js
CHANGED
|
@@ -1,39 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CommandType = void 0;
|
|
4
|
-
exports.CommandType = {
|
|
5
|
-
ApiResponse: 'api.response',
|
|
6
|
-
AsyncStorageMutation: 'asyncStorage.mutation',
|
|
7
|
-
Benchmark: 'benchmark.report',
|
|
8
|
-
ClientIntro: 'client.intro',
|
|
9
|
-
Display: 'display',
|
|
10
|
-
Image: 'image',
|
|
11
|
-
Log: 'log',
|
|
12
|
-
DataWatch: 'dataWatch',
|
|
13
|
-
ProfilerRender: 'profiler.render',
|
|
14
|
-
ProfilerFPS: 'profiler.fps',
|
|
15
|
-
SagaTaskComplete: 'saga.task.complete',
|
|
16
|
-
StateActionComplete: 'state.action.complete',
|
|
17
|
-
StateKeysResponse: 'state.keys.response',
|
|
18
|
-
StateValuesChange: 'state.values.change',
|
|
19
|
-
StateValuesResponse: 'state.values.response',
|
|
20
|
-
StateBackupResponse: 'state.backup.response',
|
|
21
|
-
StateBackupRequest: 'state.backup.request',
|
|
22
|
-
StateRestoreRequest: 'state.restore.request',
|
|
23
|
-
StateActionDispatch: 'state.action.dispatch',
|
|
24
|
-
StateValuesSubscribe: 'state.values.subscribe',
|
|
25
|
-
StateKeysRequest: 'state.keys.request',
|
|
26
|
-
StateValuesRequest: 'state.values.request',
|
|
27
|
-
CustomCommandRegister: 'customCommand.register',
|
|
28
|
-
CustomCommandUnregister: 'customCommand.unregister',
|
|
29
|
-
CustomCommandResponse: 'customCommand.response',
|
|
30
|
-
Clear: 'clear',
|
|
31
|
-
ReplLsResponse: 'repl.ls.response',
|
|
32
|
-
ReplExecuteResponse: 'repl.execute.response',
|
|
33
|
-
// these technically are commands only in dreaction-react-native, but I felt lazy so they can live here
|
|
34
|
-
DevtoolsOpen: 'devtools.open',
|
|
35
|
-
DevtoolsReload: 'devtools.reload',
|
|
36
|
-
EditorOpen: 'editor.open',
|
|
37
|
-
Storybook: 'storybook',
|
|
38
|
-
Overlay: 'overlay',
|
|
39
|
-
};
|
package/lib/customCommand.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customCommand.d.ts","sourceRoot":"","sources":["../src/customCommand.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"customCommand.d.ts","sourceRoot":"","sources":["../src/customCommand.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,CAAC,EAAE,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,GAAG,MAAM,CAAC,EAAE,CAAC;CACzD;AAED,MAAM,WAAW,4BAA4B;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,gBAAgB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,IAAI,CAAC,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,GAAG,CAAC;CACd"}
|
package/lib/index.d.ts
CHANGED
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -16,6 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./command"), exports);
|
|
18
18
|
__exportStar(require("./customCommand"), exports);
|
|
19
|
+
__exportStar(require("./issue"), exports);
|
|
19
20
|
__exportStar(require("./log"), exports);
|
|
20
21
|
__exportStar(require("./data"), exports);
|
|
21
22
|
__exportStar(require("./openInEditor"), exports);
|
package/lib/issue.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issue.d.ts","sourceRoot":"","sources":["../src/issue.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB"}
|
package/lib/issue.js
ADDED
package/package.json
CHANGED
package/src/command.ts
CHANGED
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
CustomCommandResponsePayload,
|
|
5
5
|
} from './customCommand';
|
|
6
6
|
import { DataWatchPayload } from './data';
|
|
7
|
+
import { ReportIssuePayload } from './issue';
|
|
7
8
|
import type { LogPayload } from './log';
|
|
8
9
|
import { NetworkPayload } from './network';
|
|
9
10
|
import { EditorOpenPayload } from './openInEditor';
|
|
@@ -22,88 +23,48 @@ import type {
|
|
|
22
23
|
StateValuesSubscribePayload,
|
|
23
24
|
} from './state';
|
|
24
25
|
|
|
25
|
-
export const CommandType = {
|
|
26
|
-
ApiResponse: 'api.response',
|
|
27
|
-
AsyncStorageMutation: 'asyncStorage.mutation',
|
|
28
|
-
Benchmark: 'benchmark.report',
|
|
29
|
-
ClientIntro: 'client.intro',
|
|
30
|
-
Display: 'display',
|
|
31
|
-
Image: 'image',
|
|
32
|
-
Log: 'log',
|
|
33
|
-
DataWatch: 'dataWatch',
|
|
34
|
-
ProfilerRender: 'profiler.render',
|
|
35
|
-
ProfilerFPS: 'profiler.fps',
|
|
36
|
-
SagaTaskComplete: 'saga.task.complete',
|
|
37
|
-
StateActionComplete: 'state.action.complete',
|
|
38
|
-
StateKeysResponse: 'state.keys.response',
|
|
39
|
-
StateValuesChange: 'state.values.change',
|
|
40
|
-
StateValuesResponse: 'state.values.response',
|
|
41
|
-
StateBackupResponse: 'state.backup.response',
|
|
42
|
-
StateBackupRequest: 'state.backup.request',
|
|
43
|
-
StateRestoreRequest: 'state.restore.request',
|
|
44
|
-
StateActionDispatch: 'state.action.dispatch',
|
|
45
|
-
StateValuesSubscribe: 'state.values.subscribe',
|
|
46
|
-
StateKeysRequest: 'state.keys.request',
|
|
47
|
-
StateValuesRequest: 'state.values.request',
|
|
48
|
-
CustomCommandRegister: 'customCommand.register',
|
|
49
|
-
CustomCommandUnregister: 'customCommand.unregister',
|
|
50
|
-
CustomCommandResponse: 'customCommand.response',
|
|
51
|
-
Clear: 'clear',
|
|
52
|
-
ReplLsResponse: 'repl.ls.response',
|
|
53
|
-
ReplExecuteResponse: 'repl.execute.response',
|
|
54
|
-
// these technically are commands only in dreaction-react-native, but I felt lazy so they can live here
|
|
55
|
-
DevtoolsOpen: 'devtools.open',
|
|
56
|
-
DevtoolsReload: 'devtools.reload',
|
|
57
|
-
EditorOpen: 'editor.open',
|
|
58
|
-
Storybook: 'storybook',
|
|
59
|
-
Overlay: 'overlay',
|
|
60
|
-
} as const;
|
|
61
|
-
|
|
62
|
-
export type CommandTypeKey = (typeof CommandType)[keyof typeof CommandType];
|
|
63
|
-
|
|
64
26
|
export interface CommandMap {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
[CommandType.EditorOpen]: EditorOpenPayload;
|
|
96
|
-
[CommandType.Storybook]: boolean;
|
|
97
|
-
[CommandType.Overlay]: boolean;
|
|
27
|
+
'api.response': NetworkPayload;
|
|
28
|
+
'asyncStorage.mutation': AsyncStorageMutationState;
|
|
29
|
+
'benchmark.report': any;
|
|
30
|
+
'client.intro': any;
|
|
31
|
+
display: any;
|
|
32
|
+
image: any;
|
|
33
|
+
log: LogPayload;
|
|
34
|
+
dataWatch: DataWatchPayload;
|
|
35
|
+
'profiler.render': ProfilerRenderPayload;
|
|
36
|
+
'profiler.fps': ProfilerFPSPayload;
|
|
37
|
+
'state.action.complete': StateActionCompletePayload;
|
|
38
|
+
'state.keys.response': StateKeysResponsePayload;
|
|
39
|
+
'state.values.change': StateValuesChangePayload;
|
|
40
|
+
'state.values.response': StateValuesResponsePayload;
|
|
41
|
+
'state.backup.response': StateBackupResponsePayload;
|
|
42
|
+
'state.backup.request': StateBackupRequestPayload;
|
|
43
|
+
'state.restore.request': StateRestoreRequestPayload;
|
|
44
|
+
'state.action.dispatch': StateActionDispatchPayload;
|
|
45
|
+
'state.values.subscribe': StateValuesSubscribePayload;
|
|
46
|
+
'state.keys.request': StateKeysRequestPayload;
|
|
47
|
+
'state.values.request': StateValuesRequestPayload;
|
|
48
|
+
'customCommand.register': CustomCommandRegisterPayload;
|
|
49
|
+
'customCommand.unregister': any;
|
|
50
|
+
'customCommand.response': CustomCommandResponsePayload;
|
|
51
|
+
clear: undefined;
|
|
52
|
+
'devtools.open': undefined;
|
|
53
|
+
'devtools.reload': undefined;
|
|
54
|
+
'editor.open': EditorOpenPayload;
|
|
55
|
+
overlay: boolean;
|
|
56
|
+
'report.issue': ReportIssuePayload;
|
|
98
57
|
}
|
|
99
58
|
|
|
59
|
+
export type CommandTypeKey = keyof CommandMap;
|
|
60
|
+
|
|
100
61
|
export type Command = {
|
|
101
|
-
[Type in
|
|
102
|
-
}[
|
|
62
|
+
[Type in CommandTypeKey]: CommandInferType<Type>;
|
|
63
|
+
}[CommandTypeKey];
|
|
103
64
|
|
|
104
65
|
export type CommandEvent = (command: Command) => void;
|
|
105
66
|
|
|
106
|
-
export type CommandInferType<T extends
|
|
67
|
+
export type CommandInferType<T extends CommandTypeKey> = {
|
|
107
68
|
type: T;
|
|
108
69
|
connectionId: number;
|
|
109
70
|
clientId?: string;
|
package/src/customCommand.ts
CHANGED
package/src/index.ts
CHANGED