@devvit/protos 0.11.3-next-2024-11-11-5e5902c67.0 → 0.11.3-next-2024-11-12-6a2c027f8.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.
- package/meta.min.json +114 -8
- package/package.json +6 -6
- package/protos.min.js +1 -1
- package/protos.min.js.map +4 -4
- package/schema/devvit/ui/block_kit/v1beta/enums.proto +2 -2
- package/schema/devvit/ui/effects/v1alpha/create_order.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/effect.proto +6 -1
- package/schema/devvit/ui/effects/v1alpha/interval.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/navigate_to_url.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/realtime_subscriptions.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/reload_part.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/rerender_ui.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/show_form.proto +1 -1
- package/schema/devvit/ui/effects/v1alpha/show_toast.proto +1 -1
- package/schema/devvit/ui/effects/web_view/v1alpha/fullscreen.proto +15 -0
- package/schema/devvit/ui/effects/web_view/v1alpha/post_message.proto +68 -0
- package/schema/devvit/ui/effects/web_view/v1alpha/web_view.proto +17 -0
- package/schema/devvit/ui/events/v1alpha/event.proto +2 -0
- package/schema/devvit/ui/events/v1alpha/web_view.proto +31 -0
- package/schema/snootobuf.devenv.lock +1732 -279
- package/schema/snootobuf.lock +1741 -288
- package/schema/snootobuf.redditapi.lock +1728 -279
- package/schema/snootobuf.ts.lock +1732 -279
- package/types/devvit/reddit/custom_post/v1alpha/custom_post.d.ts +132 -0
- package/types/devvit/reddit/custom_post/v1alpha/custom_post.d.ts.map +1 -1
- package/types/devvit/ui/block_kit/v1beta/enums.d.ts +3 -3
- package/types/devvit/ui/block_kit/v1beta/enums.d.ts.map +1 -1
- package/types/devvit/ui/block_kit/v1beta/enums.js +9 -9
- package/types/devvit/ui/effects/v1alpha/effect.d.ts +4 -0
- package/types/devvit/ui/effects/v1alpha/effect.d.ts.map +1 -1
- package/types/devvit/ui/effects/v1alpha/effect.js +25 -0
- package/types/devvit/ui/effects/web_view/v1alpha/fullscreen.d.ts +28 -0
- package/types/devvit/ui/effects/web_view/v1alpha/fullscreen.d.ts.map +1 -0
- package/types/devvit/ui/effects/web_view/v1alpha/fullscreen.js +79 -0
- package/types/devvit/ui/effects/web_view/v1alpha/post_message.d.ts +85 -0
- package/types/devvit/ui/effects/web_view/v1alpha/post_message.d.ts.map +1 -0
- package/types/devvit/ui/effects/web_view/v1alpha/post_message.js +273 -0
- package/types/devvit/ui/effects/web_view/v1alpha/web_view.d.ts +28 -0
- package/types/devvit/ui/effects/web_view/v1alpha/web_view.d.ts.map +1 -0
- package/types/devvit/ui/effects/web_view/v1alpha/web_view.js +85 -0
- package/types/devvit/ui/events/v1alpha/event.d.ts +2 -0
- package/types/devvit/ui/events/v1alpha/event.d.ts.map +1 -1
- package/types/devvit/ui/events/v1alpha/event.js +18 -0
- package/types/devvit/ui/events/v1alpha/web_view.d.ts +59 -0
- package/types/devvit/ui/events/v1alpha/web_view.d.ts.map +1 -0
- package/types/devvit/ui/events/v1alpha/web_view.js +219 -0
@@ -0,0 +1,85 @@
|
|
1
|
+
/**
|
2
|
+
* #post_message.ts
|
3
|
+
*
|
4
|
+
* @packageDocumentation
|
5
|
+
*/
|
6
|
+
import _m0 from "protobufjs/minimal.js";
|
7
|
+
/** Structure of messages sent via postMessage */
|
8
|
+
export interface WebViewPostMessage {
|
9
|
+
/** See comments for each message */
|
10
|
+
type: string;
|
11
|
+
/** One of the following messages converted to a Struct */
|
12
|
+
data?: {
|
13
|
+
[key: string]: any;
|
14
|
+
} | undefined;
|
15
|
+
}
|
16
|
+
/**
|
17
|
+
* Arbitrary message, sent by app via effect
|
18
|
+
* type: devvit-message
|
19
|
+
*/
|
20
|
+
export interface WebViewAppMessage {
|
21
|
+
/** Any serializable value given to postMessage in a WebView */
|
22
|
+
message?: any | undefined;
|
23
|
+
}
|
24
|
+
/**
|
25
|
+
* Used to pass stateful data into a WebView
|
26
|
+
* type: devvit-state
|
27
|
+
* @deprecated
|
28
|
+
*/
|
29
|
+
export interface WebViewStateMessage {
|
30
|
+
state?: {
|
31
|
+
[key: string]: any;
|
32
|
+
} | undefined;
|
33
|
+
}
|
34
|
+
export interface WebViewPostMessageEffect {
|
35
|
+
/** ID of the WebView block */
|
36
|
+
webViewId: string;
|
37
|
+
app?: WebViewAppMessage | undefined;
|
38
|
+
/**
|
39
|
+
* WebViewUIEventMessage event = 4;
|
40
|
+
* WebViewUIEnvironmentMessage environment = 5;
|
41
|
+
*/
|
42
|
+
state?: WebViewStateMessage | undefined;
|
43
|
+
}
|
44
|
+
export declare const WebViewPostMessage: {
|
45
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewPostMessage";
|
46
|
+
encode(message: WebViewPostMessage, writer?: _m0.Writer): _m0.Writer;
|
47
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewPostMessage;
|
48
|
+
fromJSON(object: any): WebViewPostMessage;
|
49
|
+
toJSON(message: WebViewPostMessage): unknown;
|
50
|
+
create(base?: DeepPartial<WebViewPostMessage>): WebViewPostMessage;
|
51
|
+
fromPartial(object: DeepPartial<WebViewPostMessage>): WebViewPostMessage;
|
52
|
+
};
|
53
|
+
export declare const WebViewAppMessage: {
|
54
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewAppMessage";
|
55
|
+
encode(message: WebViewAppMessage, writer?: _m0.Writer): _m0.Writer;
|
56
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewAppMessage;
|
57
|
+
fromJSON(object: any): WebViewAppMessage;
|
58
|
+
toJSON(message: WebViewAppMessage): unknown;
|
59
|
+
create(base?: DeepPartial<WebViewAppMessage>): WebViewAppMessage;
|
60
|
+
fromPartial(object: DeepPartial<WebViewAppMessage>): WebViewAppMessage;
|
61
|
+
};
|
62
|
+
export declare const WebViewStateMessage: {
|
63
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewStateMessage";
|
64
|
+
encode(message: WebViewStateMessage, writer?: _m0.Writer): _m0.Writer;
|
65
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewStateMessage;
|
66
|
+
fromJSON(object: any): WebViewStateMessage;
|
67
|
+
toJSON(message: WebViewStateMessage): unknown;
|
68
|
+
create(base?: DeepPartial<WebViewStateMessage>): WebViewStateMessage;
|
69
|
+
fromPartial(object: DeepPartial<WebViewStateMessage>): WebViewStateMessage;
|
70
|
+
};
|
71
|
+
export declare const WebViewPostMessageEffect: {
|
72
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewPostMessageEffect";
|
73
|
+
encode(message: WebViewPostMessageEffect, writer?: _m0.Writer): _m0.Writer;
|
74
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewPostMessageEffect;
|
75
|
+
fromJSON(object: any): WebViewPostMessageEffect;
|
76
|
+
toJSON(message: WebViewPostMessageEffect): unknown;
|
77
|
+
create(base?: DeepPartial<WebViewPostMessageEffect>): WebViewPostMessageEffect;
|
78
|
+
fromPartial(object: DeepPartial<WebViewPostMessageEffect>): WebViewPostMessageEffect;
|
79
|
+
};
|
80
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
81
|
+
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
82
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
83
|
+
} : Partial<T>;
|
84
|
+
export {};
|
85
|
+
//# sourceMappingURL=post_message.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"post_message.d.ts","sourceRoot":"","sources":["../../../../../../../src/types/devvit/ui/effects/web_view/v1alpha/post_message.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AA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+
*
|
4
|
+
* @packageDocumentation
|
5
|
+
*/
|
6
|
+
/* eslint-disable */
|
7
|
+
import _m0 from "protobufjs/minimal.js";
|
8
|
+
import { Struct, Value } from "../../../../../google/protobuf/struct.js";
|
9
|
+
import { messageTypeRegistry } from "../../../../../typeRegistry.js";
|
10
|
+
function createBaseWebViewPostMessage() {
|
11
|
+
return { type: "", data: undefined };
|
12
|
+
}
|
13
|
+
export const WebViewPostMessage = {
|
14
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewPostMessage",
|
15
|
+
encode(message, writer = _m0.Writer.create()) {
|
16
|
+
if (message.type !== "") {
|
17
|
+
writer.uint32(10).string(message.type);
|
18
|
+
}
|
19
|
+
if (message.data !== undefined) {
|
20
|
+
Struct.encode(Struct.wrap(message.data), writer.uint32(18).fork()).ldelim();
|
21
|
+
}
|
22
|
+
return writer;
|
23
|
+
},
|
24
|
+
decode(input, length) {
|
25
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
26
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
27
|
+
const message = createBaseWebViewPostMessage();
|
28
|
+
while (reader.pos < end) {
|
29
|
+
const tag = reader.uint32();
|
30
|
+
switch (tag >>> 3) {
|
31
|
+
case 1:
|
32
|
+
if (tag !== 10) {
|
33
|
+
break;
|
34
|
+
}
|
35
|
+
message.type = reader.string();
|
36
|
+
continue;
|
37
|
+
case 2:
|
38
|
+
if (tag !== 18) {
|
39
|
+
break;
|
40
|
+
}
|
41
|
+
message.data = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
42
|
+
continue;
|
43
|
+
}
|
44
|
+
if ((tag & 7) === 4 || tag === 0) {
|
45
|
+
break;
|
46
|
+
}
|
47
|
+
reader.skipType(tag & 7);
|
48
|
+
}
|
49
|
+
return message;
|
50
|
+
},
|
51
|
+
fromJSON(object) {
|
52
|
+
return {
|
53
|
+
type: isSet(object.type) ? globalThis.String(object.type) : "",
|
54
|
+
data: isObject(object.data) ? object.data : undefined,
|
55
|
+
};
|
56
|
+
},
|
57
|
+
toJSON(message) {
|
58
|
+
const obj = {};
|
59
|
+
if (message.type !== "") {
|
60
|
+
obj.type = message.type;
|
61
|
+
}
|
62
|
+
if (message.data !== undefined) {
|
63
|
+
obj.data = message.data;
|
64
|
+
}
|
65
|
+
return obj;
|
66
|
+
},
|
67
|
+
create(base) {
|
68
|
+
return WebViewPostMessage.fromPartial(base ?? {});
|
69
|
+
},
|
70
|
+
fromPartial(object) {
|
71
|
+
const message = createBaseWebViewPostMessage();
|
72
|
+
message.type = object.type ?? "";
|
73
|
+
message.data = object.data ?? undefined;
|
74
|
+
return message;
|
75
|
+
},
|
76
|
+
};
|
77
|
+
messageTypeRegistry.set(WebViewPostMessage.$type, WebViewPostMessage);
|
78
|
+
function createBaseWebViewAppMessage() {
|
79
|
+
return { message: undefined };
|
80
|
+
}
|
81
|
+
export const WebViewAppMessage = {
|
82
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewAppMessage",
|
83
|
+
encode(message, writer = _m0.Writer.create()) {
|
84
|
+
if (message.message !== undefined) {
|
85
|
+
Value.encode(Value.wrap(message.message), writer.uint32(10).fork()).ldelim();
|
86
|
+
}
|
87
|
+
return writer;
|
88
|
+
},
|
89
|
+
decode(input, length) {
|
90
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
91
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
92
|
+
const message = createBaseWebViewAppMessage();
|
93
|
+
while (reader.pos < end) {
|
94
|
+
const tag = reader.uint32();
|
95
|
+
switch (tag >>> 3) {
|
96
|
+
case 1:
|
97
|
+
if (tag !== 10) {
|
98
|
+
break;
|
99
|
+
}
|
100
|
+
message.message = Value.unwrap(Value.decode(reader, reader.uint32()));
|
101
|
+
continue;
|
102
|
+
}
|
103
|
+
if ((tag & 7) === 4 || tag === 0) {
|
104
|
+
break;
|
105
|
+
}
|
106
|
+
reader.skipType(tag & 7);
|
107
|
+
}
|
108
|
+
return message;
|
109
|
+
},
|
110
|
+
fromJSON(object) {
|
111
|
+
return { message: isSet(object?.message) ? object.message : undefined };
|
112
|
+
},
|
113
|
+
toJSON(message) {
|
114
|
+
const obj = {};
|
115
|
+
if (message.message !== undefined) {
|
116
|
+
obj.message = message.message;
|
117
|
+
}
|
118
|
+
return obj;
|
119
|
+
},
|
120
|
+
create(base) {
|
121
|
+
return WebViewAppMessage.fromPartial(base ?? {});
|
122
|
+
},
|
123
|
+
fromPartial(object) {
|
124
|
+
const message = createBaseWebViewAppMessage();
|
125
|
+
message.message = object.message ?? undefined;
|
126
|
+
return message;
|
127
|
+
},
|
128
|
+
};
|
129
|
+
messageTypeRegistry.set(WebViewAppMessage.$type, WebViewAppMessage);
|
130
|
+
function createBaseWebViewStateMessage() {
|
131
|
+
return { state: undefined };
|
132
|
+
}
|
133
|
+
export const WebViewStateMessage = {
|
134
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewStateMessage",
|
135
|
+
encode(message, writer = _m0.Writer.create()) {
|
136
|
+
if (message.state !== undefined) {
|
137
|
+
Struct.encode(Struct.wrap(message.state), writer.uint32(10).fork()).ldelim();
|
138
|
+
}
|
139
|
+
return writer;
|
140
|
+
},
|
141
|
+
decode(input, length) {
|
142
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
143
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
144
|
+
const message = createBaseWebViewStateMessage();
|
145
|
+
while (reader.pos < end) {
|
146
|
+
const tag = reader.uint32();
|
147
|
+
switch (tag >>> 3) {
|
148
|
+
case 1:
|
149
|
+
if (tag !== 10) {
|
150
|
+
break;
|
151
|
+
}
|
152
|
+
message.state = Struct.unwrap(Struct.decode(reader, reader.uint32()));
|
153
|
+
continue;
|
154
|
+
}
|
155
|
+
if ((tag & 7) === 4 || tag === 0) {
|
156
|
+
break;
|
157
|
+
}
|
158
|
+
reader.skipType(tag & 7);
|
159
|
+
}
|
160
|
+
return message;
|
161
|
+
},
|
162
|
+
fromJSON(object) {
|
163
|
+
return { state: isObject(object.state) ? object.state : undefined };
|
164
|
+
},
|
165
|
+
toJSON(message) {
|
166
|
+
const obj = {};
|
167
|
+
if (message.state !== undefined) {
|
168
|
+
obj.state = message.state;
|
169
|
+
}
|
170
|
+
return obj;
|
171
|
+
},
|
172
|
+
create(base) {
|
173
|
+
return WebViewStateMessage.fromPartial(base ?? {});
|
174
|
+
},
|
175
|
+
fromPartial(object) {
|
176
|
+
const message = createBaseWebViewStateMessage();
|
177
|
+
message.state = object.state ?? undefined;
|
178
|
+
return message;
|
179
|
+
},
|
180
|
+
};
|
181
|
+
messageTypeRegistry.set(WebViewStateMessage.$type, WebViewStateMessage);
|
182
|
+
function createBaseWebViewPostMessageEffect() {
|
183
|
+
return { webViewId: "", app: undefined, state: undefined };
|
184
|
+
}
|
185
|
+
export const WebViewPostMessageEffect = {
|
186
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewPostMessageEffect",
|
187
|
+
encode(message, writer = _m0.Writer.create()) {
|
188
|
+
if (message.webViewId !== "") {
|
189
|
+
writer.uint32(10).string(message.webViewId);
|
190
|
+
}
|
191
|
+
if (message.app !== undefined) {
|
192
|
+
WebViewAppMessage.encode(message.app, writer.uint32(18).fork()).ldelim();
|
193
|
+
}
|
194
|
+
if (message.state !== undefined) {
|
195
|
+
WebViewStateMessage.encode(message.state, writer.uint32(26).fork()).ldelim();
|
196
|
+
}
|
197
|
+
return writer;
|
198
|
+
},
|
199
|
+
decode(input, length) {
|
200
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
201
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
202
|
+
const message = createBaseWebViewPostMessageEffect();
|
203
|
+
while (reader.pos < end) {
|
204
|
+
const tag = reader.uint32();
|
205
|
+
switch (tag >>> 3) {
|
206
|
+
case 1:
|
207
|
+
if (tag !== 10) {
|
208
|
+
break;
|
209
|
+
}
|
210
|
+
message.webViewId = reader.string();
|
211
|
+
continue;
|
212
|
+
case 2:
|
213
|
+
if (tag !== 18) {
|
214
|
+
break;
|
215
|
+
}
|
216
|
+
message.app = WebViewAppMessage.decode(reader, reader.uint32());
|
217
|
+
continue;
|
218
|
+
case 3:
|
219
|
+
if (tag !== 26) {
|
220
|
+
break;
|
221
|
+
}
|
222
|
+
message.state = WebViewStateMessage.decode(reader, reader.uint32());
|
223
|
+
continue;
|
224
|
+
}
|
225
|
+
if ((tag & 7) === 4 || tag === 0) {
|
226
|
+
break;
|
227
|
+
}
|
228
|
+
reader.skipType(tag & 7);
|
229
|
+
}
|
230
|
+
return message;
|
231
|
+
},
|
232
|
+
fromJSON(object) {
|
233
|
+
return {
|
234
|
+
webViewId: isSet(object.webViewId) ? globalThis.String(object.webViewId) : "",
|
235
|
+
app: isSet(object.app) ? WebViewAppMessage.fromJSON(object.app) : undefined,
|
236
|
+
state: isSet(object.state) ? WebViewStateMessage.fromJSON(object.state) : undefined,
|
237
|
+
};
|
238
|
+
},
|
239
|
+
toJSON(message) {
|
240
|
+
const obj = {};
|
241
|
+
if (message.webViewId !== "") {
|
242
|
+
obj.webViewId = message.webViewId;
|
243
|
+
}
|
244
|
+
if (message.app !== undefined) {
|
245
|
+
obj.app = WebViewAppMessage.toJSON(message.app);
|
246
|
+
}
|
247
|
+
if (message.state !== undefined) {
|
248
|
+
obj.state = WebViewStateMessage.toJSON(message.state);
|
249
|
+
}
|
250
|
+
return obj;
|
251
|
+
},
|
252
|
+
create(base) {
|
253
|
+
return WebViewPostMessageEffect.fromPartial(base ?? {});
|
254
|
+
},
|
255
|
+
fromPartial(object) {
|
256
|
+
const message = createBaseWebViewPostMessageEffect();
|
257
|
+
message.webViewId = object.webViewId ?? "";
|
258
|
+
message.app = (object.app !== undefined && object.app !== null)
|
259
|
+
? WebViewAppMessage.fromPartial(object.app)
|
260
|
+
: undefined;
|
261
|
+
message.state = (object.state !== undefined && object.state !== null)
|
262
|
+
? WebViewStateMessage.fromPartial(object.state)
|
263
|
+
: undefined;
|
264
|
+
return message;
|
265
|
+
},
|
266
|
+
};
|
267
|
+
messageTypeRegistry.set(WebViewPostMessageEffect.$type, WebViewPostMessageEffect);
|
268
|
+
function isObject(value) {
|
269
|
+
return typeof value === "object" && value !== null;
|
270
|
+
}
|
271
|
+
function isSet(value) {
|
272
|
+
return value !== null && value !== undefined;
|
273
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
/**
|
2
|
+
* #web_view.ts
|
3
|
+
*
|
4
|
+
* @packageDocumentation
|
5
|
+
*/
|
6
|
+
import _m0 from "protobufjs/minimal.js";
|
7
|
+
import { WebViewFullScreenVisibilityEffect } from "./fullscreen.js";
|
8
|
+
import { WebViewPostMessageEffect } from "./post_message.js";
|
9
|
+
/** Effect to communicate and control WebViews */
|
10
|
+
export interface WebViewEffect {
|
11
|
+
postMessage?: WebViewPostMessageEffect | undefined;
|
12
|
+
fullscreen?: WebViewFullScreenVisibilityEffect | undefined;
|
13
|
+
}
|
14
|
+
export declare const WebViewEffect: {
|
15
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewEffect";
|
16
|
+
encode(message: WebViewEffect, writer?: _m0.Writer): _m0.Writer;
|
17
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewEffect;
|
18
|
+
fromJSON(object: any): WebViewEffect;
|
19
|
+
toJSON(message: WebViewEffect): unknown;
|
20
|
+
create(base?: DeepPartial<WebViewEffect>): WebViewEffect;
|
21
|
+
fromPartial(object: DeepPartial<WebViewEffect>): WebViewEffect;
|
22
|
+
};
|
23
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
24
|
+
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
25
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
26
|
+
} : Partial<T>;
|
27
|
+
export {};
|
28
|
+
//# sourceMappingURL=web_view.d.ts.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CAAE,GACrD,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
/**
|
2
|
+
* #web_view.ts
|
3
|
+
*
|
4
|
+
* @packageDocumentation
|
5
|
+
*/
|
6
|
+
/* eslint-disable */
|
7
|
+
import _m0 from "protobufjs/minimal.js";
|
8
|
+
import { messageTypeRegistry } from "../../../../../typeRegistry.js";
|
9
|
+
import { WebViewFullScreenVisibilityEffect } from "./fullscreen.js";
|
10
|
+
import { WebViewPostMessageEffect } from "./post_message.js";
|
11
|
+
function createBaseWebViewEffect() {
|
12
|
+
return { postMessage: undefined, fullscreen: undefined };
|
13
|
+
}
|
14
|
+
export const WebViewEffect = {
|
15
|
+
$type: "devvit.ui.effects.web_view.v1alpha.WebViewEffect",
|
16
|
+
encode(message, writer = _m0.Writer.create()) {
|
17
|
+
if (message.postMessage !== undefined) {
|
18
|
+
WebViewPostMessageEffect.encode(message.postMessage, writer.uint32(10).fork()).ldelim();
|
19
|
+
}
|
20
|
+
if (message.fullscreen !== undefined) {
|
21
|
+
WebViewFullScreenVisibilityEffect.encode(message.fullscreen, writer.uint32(18).fork()).ldelim();
|
22
|
+
}
|
23
|
+
return writer;
|
24
|
+
},
|
25
|
+
decode(input, length) {
|
26
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
27
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
28
|
+
const message = createBaseWebViewEffect();
|
29
|
+
while (reader.pos < end) {
|
30
|
+
const tag = reader.uint32();
|
31
|
+
switch (tag >>> 3) {
|
32
|
+
case 1:
|
33
|
+
if (tag !== 10) {
|
34
|
+
break;
|
35
|
+
}
|
36
|
+
message.postMessage = WebViewPostMessageEffect.decode(reader, reader.uint32());
|
37
|
+
continue;
|
38
|
+
case 2:
|
39
|
+
if (tag !== 18) {
|
40
|
+
break;
|
41
|
+
}
|
42
|
+
message.fullscreen = WebViewFullScreenVisibilityEffect.decode(reader, reader.uint32());
|
43
|
+
continue;
|
44
|
+
}
|
45
|
+
if ((tag & 7) === 4 || tag === 0) {
|
46
|
+
break;
|
47
|
+
}
|
48
|
+
reader.skipType(tag & 7);
|
49
|
+
}
|
50
|
+
return message;
|
51
|
+
},
|
52
|
+
fromJSON(object) {
|
53
|
+
return {
|
54
|
+
postMessage: isSet(object.postMessage) ? WebViewPostMessageEffect.fromJSON(object.postMessage) : undefined,
|
55
|
+
fullscreen: isSet(object.fullscreen) ? WebViewFullScreenVisibilityEffect.fromJSON(object.fullscreen) : undefined,
|
56
|
+
};
|
57
|
+
},
|
58
|
+
toJSON(message) {
|
59
|
+
const obj = {};
|
60
|
+
if (message.postMessage !== undefined) {
|
61
|
+
obj.postMessage = WebViewPostMessageEffect.toJSON(message.postMessage);
|
62
|
+
}
|
63
|
+
if (message.fullscreen !== undefined) {
|
64
|
+
obj.fullscreen = WebViewFullScreenVisibilityEffect.toJSON(message.fullscreen);
|
65
|
+
}
|
66
|
+
return obj;
|
67
|
+
},
|
68
|
+
create(base) {
|
69
|
+
return WebViewEffect.fromPartial(base ?? {});
|
70
|
+
},
|
71
|
+
fromPartial(object) {
|
72
|
+
const message = createBaseWebViewEffect();
|
73
|
+
message.postMessage = (object.postMessage !== undefined && object.postMessage !== null)
|
74
|
+
? WebViewPostMessageEffect.fromPartial(object.postMessage)
|
75
|
+
: undefined;
|
76
|
+
message.fullscreen = (object.fullscreen !== undefined && object.fullscreen !== null)
|
77
|
+
? WebViewFullScreenVisibilityEffect.fromPartial(object.fullscreen)
|
78
|
+
: undefined;
|
79
|
+
return message;
|
80
|
+
},
|
81
|
+
};
|
82
|
+
messageTypeRegistry.set(WebViewEffect.$type, WebViewEffect);
|
83
|
+
function isSet(value) {
|
84
|
+
return value !== null && value !== undefined;
|
85
|
+
}
|
@@ -8,6 +8,7 @@ import { OrderResultEvent } from "../../effects/v1alpha/create_order.js";
|
|
8
8
|
import { RealtimeSubscriptionEvent } from "../../effects/v1alpha/realtime_subscriptions.js";
|
9
9
|
import { FormSubmittedEvent } from "../../effects/v1alpha/show_form.js";
|
10
10
|
import { ToastActionEvent } from "../../effects/v1alpha/show_toast.js";
|
11
|
+
import { WebViewEvent } from "./web_view.js";
|
11
12
|
/**
|
12
13
|
* This is set when we want to map events to a specific runtime, examples:
|
13
14
|
* [1] incoming realtime messages on a websocket connection
|
@@ -33,6 +34,7 @@ export interface UIEvent {
|
|
33
34
|
timer?: TimerEvent | undefined;
|
34
35
|
blocking?: BlockingRenderEvent | undefined;
|
35
36
|
resize?: ResizeEvent | undefined;
|
37
|
+
webView?: WebViewEvent | undefined;
|
36
38
|
/**
|
37
39
|
* If an event is async, it can be fired in parallel with other events. Async events
|
38
40
|
* are not allowed to mutate state. Any state mutations they attempt would be ignored.
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../../../../src/types/devvit/ui/events/v1alpha/event.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;
|
1
|
+
{"version":3,"file":"event.d.ts","sourceRoot":"","sources":["../../../../../../src/types/devvit/ui/events/v1alpha/event.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC,OAAO,EAAE,gBAAgB,EAAE,MAAM,uCAAuC,CAAC;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,iDAAiD,CAAC;AAC5F,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AACxE,OAAO,EAAE,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AACvE,OAAO,EAAE,YAAY,EAA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,OAAO;kBAczB,YAAY,aAAa,CAAC,GAAG,aAAa;wBAGpC,YAAY,aAAa,CAAC,GAAG,aAAa;CAS/D,CAAC;AAQF,eAAO,MAAM,UAAU;;oBAGL,UAAU,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAUnE,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,UAAU;qBA8BlD,GAAG,GAAG,UAAU;oBAOjB,UAAU,GAAG,OAAO;kBAWtB,YAAY,UAAU,CAAC,GAAG,UAAU;wBAG9B,YAAY,UAAU,CAAC,GAAG,UAAU;CAMzD,CAAC;AAIF,KAAK,OAAO,GAAG,IAAI,GAAG,QAAQ,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC;AAEpF,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,OAAO,GAAG,CAAC,GACvC,CAAC,SAAS,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GACtE,CAAC,SAAS,aAAa,CAAC,MAAM,CAAC,CAAC,GAAG,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,GAChE,CAAC,SAAS,EAAE,GAAG;KAAG,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;CAAE,GACrD,OAAO,CAAC,CAAC,CAAC,CAAC"}
|
@@ -12,6 +12,7 @@ import { OrderResultEvent } from "../../effects/v1alpha/create_order.js";
|
|
12
12
|
import { RealtimeSubscriptionEvent } from "../../effects/v1alpha/realtime_subscriptions.js";
|
13
13
|
import { FormSubmittedEvent } from "../../effects/v1alpha/show_form.js";
|
14
14
|
import { ToastActionEvent } from "../../effects/v1alpha/show_toast.js";
|
15
|
+
import { WebViewEvent } from "./web_view.js";
|
15
16
|
/**
|
16
17
|
* This is set when we want to map events to a specific runtime, examples:
|
17
18
|
* [1] incoming realtime messages on a websocket connection
|
@@ -67,6 +68,7 @@ function createBaseUIEvent() {
|
|
67
68
|
timer: undefined,
|
68
69
|
blocking: undefined,
|
69
70
|
resize: undefined,
|
71
|
+
webView: undefined,
|
70
72
|
async: undefined,
|
71
73
|
hook: undefined,
|
72
74
|
retry: undefined,
|
@@ -106,6 +108,9 @@ export const UIEvent = {
|
|
106
108
|
if (message.resize !== undefined) {
|
107
109
|
ResizeEvent.encode(message.resize, writer.uint32(114).fork()).ldelim();
|
108
110
|
}
|
111
|
+
if (message.webView !== undefined) {
|
112
|
+
WebViewEvent.encode(message.webView, writer.uint32(162).fork()).ldelim();
|
113
|
+
}
|
109
114
|
if (message.async !== undefined) {
|
110
115
|
BoolValue.encode({ value: message.async }, writer.uint32(122).fork()).ldelim();
|
111
116
|
}
|
@@ -187,6 +192,12 @@ export const UIEvent = {
|
|
187
192
|
}
|
188
193
|
message.resize = ResizeEvent.decode(reader, reader.uint32());
|
189
194
|
continue;
|
195
|
+
case 20:
|
196
|
+
if (tag !== 162) {
|
197
|
+
break;
|
198
|
+
}
|
199
|
+
message.webView = WebViewEvent.decode(reader, reader.uint32());
|
200
|
+
continue;
|
190
201
|
case 15:
|
191
202
|
if (tag !== 122) {
|
192
203
|
break;
|
@@ -231,6 +242,7 @@ export const UIEvent = {
|
|
231
242
|
timer: isSet(object.timer) ? TimerEvent.fromJSON(object.timer) : undefined,
|
232
243
|
blocking: isSet(object.blocking) ? BlockingRenderEvent.fromJSON(object.blocking) : undefined,
|
233
244
|
resize: isSet(object.resize) ? ResizeEvent.fromJSON(object.resize) : undefined,
|
245
|
+
webView: isSet(object.webView) ? WebViewEvent.fromJSON(object.webView) : undefined,
|
234
246
|
async: isSet(object.async) ? Boolean(object.async) : undefined,
|
235
247
|
hook: isSet(object.hook) ? String(object.hook) : undefined,
|
236
248
|
retry: isSet(object.retry) ? Boolean(object.retry) : undefined,
|
@@ -269,6 +281,9 @@ export const UIEvent = {
|
|
269
281
|
if (message.resize !== undefined) {
|
270
282
|
obj.resize = ResizeEvent.toJSON(message.resize);
|
271
283
|
}
|
284
|
+
if (message.webView !== undefined) {
|
285
|
+
obj.webView = WebViewEvent.toJSON(message.webView);
|
286
|
+
}
|
272
287
|
if (message.async !== undefined) {
|
273
288
|
obj.async = message.async;
|
274
289
|
}
|
@@ -318,6 +333,9 @@ export const UIEvent = {
|
|
318
333
|
message.resize = (object.resize !== undefined && object.resize !== null)
|
319
334
|
? ResizeEvent.fromPartial(object.resize)
|
320
335
|
: undefined;
|
336
|
+
message.webView = (object.webView !== undefined && object.webView !== null)
|
337
|
+
? WebViewEvent.fromPartial(object.webView)
|
338
|
+
: undefined;
|
321
339
|
message.async = object.async ?? undefined;
|
322
340
|
message.hook = object.hook ?? undefined;
|
323
341
|
message.retry = object.retry ?? undefined;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
/**
|
2
|
+
* #web_view.ts
|
3
|
+
*
|
4
|
+
* @packageDocumentation
|
5
|
+
*/
|
6
|
+
import _m0 from "protobufjs/minimal.js";
|
7
|
+
export declare enum WebViewVisibility {
|
8
|
+
WEBVIEW_VISIBLE = 0,
|
9
|
+
WEBVIEW_HIDDEN = 1,
|
10
|
+
UNRECOGNIZED = -1
|
11
|
+
}
|
12
|
+
export declare function webViewVisibilityFromJSON(object: any): WebViewVisibility;
|
13
|
+
export declare function webViewVisibilityToJSON(object: WebViewVisibility): number;
|
14
|
+
/** Fired when the content of a WebView calls window.parent.postMessage() */
|
15
|
+
export interface WebViewPostMessageEvent {
|
16
|
+
/** Can be a Struct or a scalar value since postMessage doesn't restrict the type of 'message'. */
|
17
|
+
message?: any | undefined;
|
18
|
+
}
|
19
|
+
/** Fired when the visibility of a fullscreen WebView changes */
|
20
|
+
export interface WebViewFullScreenEvent {
|
21
|
+
visibility: WebViewVisibility;
|
22
|
+
}
|
23
|
+
export interface WebViewEvent {
|
24
|
+
postMessage?: WebViewPostMessageEvent | undefined;
|
25
|
+
fullScreen?: WebViewFullScreenEvent | undefined;
|
26
|
+
}
|
27
|
+
export declare const WebViewPostMessageEvent: {
|
28
|
+
$type: "devvit.ui.events.v1alpha.WebViewPostMessageEvent";
|
29
|
+
encode(message: WebViewPostMessageEvent, writer?: _m0.Writer): _m0.Writer;
|
30
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewPostMessageEvent;
|
31
|
+
fromJSON(object: any): WebViewPostMessageEvent;
|
32
|
+
toJSON(message: WebViewPostMessageEvent): unknown;
|
33
|
+
create(base?: DeepPartial<WebViewPostMessageEvent>): WebViewPostMessageEvent;
|
34
|
+
fromPartial(object: DeepPartial<WebViewPostMessageEvent>): WebViewPostMessageEvent;
|
35
|
+
};
|
36
|
+
export declare const WebViewFullScreenEvent: {
|
37
|
+
$type: "devvit.ui.events.v1alpha.WebViewFullScreenEvent";
|
38
|
+
encode(message: WebViewFullScreenEvent, writer?: _m0.Writer): _m0.Writer;
|
39
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewFullScreenEvent;
|
40
|
+
fromJSON(object: any): WebViewFullScreenEvent;
|
41
|
+
toJSON(message: WebViewFullScreenEvent): unknown;
|
42
|
+
create(base?: DeepPartial<WebViewFullScreenEvent>): WebViewFullScreenEvent;
|
43
|
+
fromPartial(object: DeepPartial<WebViewFullScreenEvent>): WebViewFullScreenEvent;
|
44
|
+
};
|
45
|
+
export declare const WebViewEvent: {
|
46
|
+
$type: "devvit.ui.events.v1alpha.WebViewEvent";
|
47
|
+
encode(message: WebViewEvent, writer?: _m0.Writer): _m0.Writer;
|
48
|
+
decode(input: _m0.Reader | Uint8Array, length?: number): WebViewEvent;
|
49
|
+
fromJSON(object: any): WebViewEvent;
|
50
|
+
toJSON(message: WebViewEvent): unknown;
|
51
|
+
create(base?: DeepPartial<WebViewEvent>): WebViewEvent;
|
52
|
+
fromPartial(object: DeepPartial<WebViewEvent>): WebViewEvent;
|
53
|
+
};
|
54
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
55
|
+
type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
56
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
57
|
+
} : Partial<T>;
|
58
|
+
export {};
|
59
|
+
//# sourceMappingURL=web_view.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"web_view.d.ts","sourceRoot":"","sources":["../../../../../../src/types/devvit/ui/events/v1alpha/web_view.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,GAAG,MAAM,uBAAuB,CAAC;AAIxC,oBAAY,iBAAiB;IAC3B,eAAe,IAAI;IACnB,cAAc,IAAI;IAClB,YAAY,KAAK;CAClB;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,GAAG,GAAG,iBAAiB,CAaxE;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,iBAAiB,GAAG,MAAM,CAUzE;AAED,4EAA4E;AAC5E,MAAM,WAAW,uBAAuB;IACtC,kGAAkG;IAClG,OAAO,CAAC,EAAE,GAAG,GAAG,SAAS,CAAC;CAC3B;AAED,gEAAgE;AAChE,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,iBAAiB,CAAC;CAC/B;AAED,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,uBAAuB,GAAG,SAAS,CAAC;IAClD,UAAU,CAAC,EAAE,sBAAsB,GAAG,SAAS,CAAC;CACjD;AAMD,eAAO,MAAM,uBAAuB;;oBAGlB,uBAAuB,WAAU,IAAI,MAAM,GAAyB,IAAI,MAAM;kBAOhF,IAAI,MAAM,GAAG,UAAU,WAAW,MAAM,GAAG,uBAAuB;qBAuB/D,GAAG,GAAG,uBAAuB;oBAI9B,uBAAuB,GAAG,OAAO;kBAQnC,YAAY,uBAAuB,CAAC,GAAG,uBAAuB;wBAGxD,YAAY,uBAAuB,C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