@edhspace/api 0.0.0-stage → 0.1.0

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.
@@ -0,0 +1,136 @@
1
+ import * as zod from 'zod';
2
+ import { n as ExtensionInvoker, d as ExtensionPermission, D as DeckOperation, o as NetworkRequest, a as ExtensionArguments } from './contracts-r8d4RACz.js';
3
+
4
+ type ExtensionClient = ReturnType<typeof createExtensionClient>;
5
+ declare function createExtensionClient(invoke: ExtensionInvoker, sessionId: string, permissions: readonly ExtensionPermission[], timeoutMs?: number, networkTimeoutMs?: number): {
6
+ permissions: readonly ("deck.read" | "selection.read" | "deck.propose" | "cards.inspect" | "cards.search" | "workspace.open" | "notifications.show" | "storage.read" | "storage.write" | "preferences.read" | "preferences.write" | "network.request")[];
7
+ deck: {
8
+ read: () => Promise<{
9
+ id: string;
10
+ name: string;
11
+ format: string;
12
+ revision: string;
13
+ cards: {
14
+ id: string;
15
+ name: string;
16
+ quantity: number;
17
+ manaCost?: string | undefined;
18
+ manaValue?: number | undefined;
19
+ typeLine?: string | undefined;
20
+ commander?: boolean | undefined;
21
+ }[];
22
+ }>;
23
+ propose: (operations: DeckOperation[]) => Promise<{
24
+ id: string;
25
+ status: "pending" | "dismissed";
26
+ revision?: string | undefined;
27
+ undoId?: string | undefined;
28
+ } | {
29
+ id: string;
30
+ status: "applied";
31
+ revision: string;
32
+ undoId: string;
33
+ }>;
34
+ addCard: (cardId: string, category: string, quantity?: number) => Promise<{
35
+ id: string;
36
+ status: "pending" | "dismissed";
37
+ revision?: string | undefined;
38
+ undoId?: string | undefined;
39
+ } | {
40
+ id: string;
41
+ status: "applied";
42
+ revision: string;
43
+ undoId: string;
44
+ }>;
45
+ removeCard: (cardId: string, quantity?: number) => Promise<{
46
+ id: string;
47
+ status: "pending" | "dismissed";
48
+ revision?: string | undefined;
49
+ undoId?: string | undefined;
50
+ } | {
51
+ id: string;
52
+ status: "applied";
53
+ revision: string;
54
+ undoId: string;
55
+ }>;
56
+ applyTags: (cardIds: string[], tags: string[]) => Promise<{
57
+ id: string;
58
+ status: "pending" | "dismissed";
59
+ revision?: string | undefined;
60
+ undoId?: string | undefined;
61
+ } | {
62
+ id: string;
63
+ status: "applied";
64
+ revision: string;
65
+ undoId: string;
66
+ }>;
67
+ };
68
+ selection: {
69
+ read: () => Promise<{
70
+ id: string;
71
+ name: string;
72
+ quantity: number;
73
+ manaCost?: string | undefined;
74
+ manaValue?: number | undefined;
75
+ typeLine?: string | undefined;
76
+ commander?: boolean | undefined;
77
+ }[]>;
78
+ };
79
+ network: {
80
+ request: (request: NetworkRequest) => Promise<{
81
+ status: number;
82
+ data: zod.JSONType;
83
+ }>;
84
+ };
85
+ cards: {
86
+ inspect: (cardId: string) => Promise<{
87
+ opened: true;
88
+ }>;
89
+ search: (query: string, page?: number) => Promise<{
90
+ cards: {
91
+ id: string;
92
+ name: string;
93
+ quantity: number;
94
+ manaCost?: string | undefined;
95
+ manaValue?: number | undefined;
96
+ typeLine?: string | undefined;
97
+ commander?: boolean | undefined;
98
+ }[];
99
+ nextPage?: number | undefined;
100
+ }>;
101
+ getByName: (name: string) => Promise<{
102
+ id: string;
103
+ name: string;
104
+ quantity: number;
105
+ manaCost?: string | undefined;
106
+ manaValue?: number | undefined;
107
+ typeLine?: string | undefined;
108
+ commander?: boolean | undefined;
109
+ } | null>;
110
+ };
111
+ workspace: {
112
+ openPanel: (panelId: string, location?: "workspace" | "sidebar") => Promise<{
113
+ panelId: string;
114
+ }>;
115
+ };
116
+ notifications: {
117
+ show: (message: string, kind?: "info" | "success" | "error") => Promise<{
118
+ shown: true;
119
+ }>;
120
+ };
121
+ storage: {
122
+ get: (key: string) => Promise<zod.JSONType>;
123
+ set: (key: string, value: ExtensionArguments["storage.set"]["value"]) => Promise<{
124
+ saved: true;
125
+ }>;
126
+ };
127
+ preferences: {
128
+ get: () => Promise<Record<string, zod.JSONType>>;
129
+ set: (key: string, value: ExtensionArguments["preferences.set"]["value"]) => Promise<{
130
+ saved: true;
131
+ }>;
132
+ };
133
+ dispose: () => void;
134
+ };
135
+
136
+ export { type ExtensionClient as E, createExtensionClient as c };
@@ -0,0 +1,136 @@
1
+ import * as zod from 'zod';
2
+ import { n as ExtensionInvoker, d as ExtensionPermission, D as DeckOperation, o as NetworkRequest, a as ExtensionArguments } from './contracts-r8d4RACz.cjs';
3
+
4
+ type ExtensionClient = ReturnType<typeof createExtensionClient>;
5
+ declare function createExtensionClient(invoke: ExtensionInvoker, sessionId: string, permissions: readonly ExtensionPermission[], timeoutMs?: number, networkTimeoutMs?: number): {
6
+ permissions: readonly ("deck.read" | "selection.read" | "deck.propose" | "cards.inspect" | "cards.search" | "workspace.open" | "notifications.show" | "storage.read" | "storage.write" | "preferences.read" | "preferences.write" | "network.request")[];
7
+ deck: {
8
+ read: () => Promise<{
9
+ id: string;
10
+ name: string;
11
+ format: string;
12
+ revision: string;
13
+ cards: {
14
+ id: string;
15
+ name: string;
16
+ quantity: number;
17
+ manaCost?: string | undefined;
18
+ manaValue?: number | undefined;
19
+ typeLine?: string | undefined;
20
+ commander?: boolean | undefined;
21
+ }[];
22
+ }>;
23
+ propose: (operations: DeckOperation[]) => Promise<{
24
+ id: string;
25
+ status: "pending" | "dismissed";
26
+ revision?: string | undefined;
27
+ undoId?: string | undefined;
28
+ } | {
29
+ id: string;
30
+ status: "applied";
31
+ revision: string;
32
+ undoId: string;
33
+ }>;
34
+ addCard: (cardId: string, category: string, quantity?: number) => Promise<{
35
+ id: string;
36
+ status: "pending" | "dismissed";
37
+ revision?: string | undefined;
38
+ undoId?: string | undefined;
39
+ } | {
40
+ id: string;
41
+ status: "applied";
42
+ revision: string;
43
+ undoId: string;
44
+ }>;
45
+ removeCard: (cardId: string, quantity?: number) => Promise<{
46
+ id: string;
47
+ status: "pending" | "dismissed";
48
+ revision?: string | undefined;
49
+ undoId?: string | undefined;
50
+ } | {
51
+ id: string;
52
+ status: "applied";
53
+ revision: string;
54
+ undoId: string;
55
+ }>;
56
+ applyTags: (cardIds: string[], tags: string[]) => Promise<{
57
+ id: string;
58
+ status: "pending" | "dismissed";
59
+ revision?: string | undefined;
60
+ undoId?: string | undefined;
61
+ } | {
62
+ id: string;
63
+ status: "applied";
64
+ revision: string;
65
+ undoId: string;
66
+ }>;
67
+ };
68
+ selection: {
69
+ read: () => Promise<{
70
+ id: string;
71
+ name: string;
72
+ quantity: number;
73
+ manaCost?: string | undefined;
74
+ manaValue?: number | undefined;
75
+ typeLine?: string | undefined;
76
+ commander?: boolean | undefined;
77
+ }[]>;
78
+ };
79
+ network: {
80
+ request: (request: NetworkRequest) => Promise<{
81
+ status: number;
82
+ data: zod.JSONType;
83
+ }>;
84
+ };
85
+ cards: {
86
+ inspect: (cardId: string) => Promise<{
87
+ opened: true;
88
+ }>;
89
+ search: (query: string, page?: number) => Promise<{
90
+ cards: {
91
+ id: string;
92
+ name: string;
93
+ quantity: number;
94
+ manaCost?: string | undefined;
95
+ manaValue?: number | undefined;
96
+ typeLine?: string | undefined;
97
+ commander?: boolean | undefined;
98
+ }[];
99
+ nextPage?: number | undefined;
100
+ }>;
101
+ getByName: (name: string) => Promise<{
102
+ id: string;
103
+ name: string;
104
+ quantity: number;
105
+ manaCost?: string | undefined;
106
+ manaValue?: number | undefined;
107
+ typeLine?: string | undefined;
108
+ commander?: boolean | undefined;
109
+ } | null>;
110
+ };
111
+ workspace: {
112
+ openPanel: (panelId: string, location?: "workspace" | "sidebar") => Promise<{
113
+ panelId: string;
114
+ }>;
115
+ };
116
+ notifications: {
117
+ show: (message: string, kind?: "info" | "success" | "error") => Promise<{
118
+ shown: true;
119
+ }>;
120
+ };
121
+ storage: {
122
+ get: (key: string) => Promise<zod.JSONType>;
123
+ set: (key: string, value: ExtensionArguments["storage.set"]["value"]) => Promise<{
124
+ saved: true;
125
+ }>;
126
+ };
127
+ preferences: {
128
+ get: () => Promise<Record<string, zod.JSONType>>;
129
+ set: (key: string, value: ExtensionArguments["preferences.set"]["value"]) => Promise<{
130
+ saved: true;
131
+ }>;
132
+ };
133
+ dispose: () => void;
134
+ };
135
+
136
+ export { type ExtensionClient as E, createExtensionClient as c };