@devvit/shared 0.11.20-next-2025-08-12-00-07-21-b7c03d104.0 → 0.11.20-next-2025-08-12-01-33-03-ce5410d2e.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/index.d.ts +1 -1
- package/index.d.ts.map +1 -1
- package/index.js +1 -1
- package/package.json +6 -6
- package/types/ui-response.d.ts +1 -1
- package/types/ui-response.d.ts.map +1 -1
- package/types/form.d.ts +0 -90
- package/types/form.d.ts.map +0 -1
- package/types/form.js +0 -5
package/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export * from './types/baseContext.js';
|
|
2
|
-
export * from './types/form.js';
|
|
3
2
|
export * from './types/menu-item.js';
|
|
4
3
|
export * from './types/settings.js';
|
|
5
4
|
export * from './types/triggers.js';
|
|
6
5
|
export * from './types/ui-response.js';
|
|
7
6
|
export * from '@devvit/shared-types/json.js';
|
|
7
|
+
export * from '@devvit/shared-types/shared/form.js';
|
|
8
8
|
export * from '@devvit/shared-types/tid.js';
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qCAAqC,CAAC;AACpD,cAAc,6BAA6B,CAAC"}
|
package/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export * from './types/baseContext.js';
|
|
2
|
-
export * from './types/form.js';
|
|
3
2
|
export * from './types/menu-item.js';
|
|
4
3
|
export * from './types/settings.js';
|
|
5
4
|
export * from './types/triggers.js';
|
|
6
5
|
export * from './types/ui-response.js';
|
|
7
6
|
export * from '@devvit/shared-types/json.js';
|
|
7
|
+
export * from '@devvit/shared-types/shared/form.js';
|
|
8
8
|
export * from '@devvit/shared-types/tid.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devvit/shared",
|
|
3
|
-
"version": "0.11.20-next-2025-08-12-
|
|
3
|
+
"version": "0.11.20-next-2025-08-12-01-33-03-ce5410d2e.0",
|
|
4
4
|
"license": "BSD-3-Clause",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,16 +30,16 @@
|
|
|
30
30
|
},
|
|
31
31
|
"types": "./dist/index.d.ts",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@devvit/protos": "0.11.20-next-2025-08-12-
|
|
34
|
-
"@devvit/shared-types": "0.11.20-next-2025-08-12-
|
|
33
|
+
"@devvit/protos": "0.11.20-next-2025-08-12-01-33-03-ce5410d2e.0",
|
|
34
|
+
"@devvit/shared-types": "0.11.20-next-2025-08-12-01-33-03-ce5410d2e.0"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@devvit/repo-tools": "0.11.20-next-2025-08-12-
|
|
38
|
-
"@devvit/tsconfig": "0.11.20-next-2025-08-12-
|
|
37
|
+
"@devvit/repo-tools": "0.11.20-next-2025-08-12-01-33-03-ce5410d2e.0",
|
|
38
|
+
"@devvit/tsconfig": "0.11.20-next-2025-08-12-01-33-03-ce5410d2e.0",
|
|
39
39
|
"eslint": "9.11.1",
|
|
40
40
|
"typescript": "5.8.3",
|
|
41
41
|
"vitest": "1.6.1"
|
|
42
42
|
},
|
|
43
43
|
"source": "./src/index.ts",
|
|
44
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "d067b8b4edefe1c103fd83f680198c93bc52b6e7"
|
|
45
45
|
}
|
package/types/ui-response.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonObject } from '@devvit/shared-types/json.js';
|
|
2
|
-
import type { Form, FormValues } from '
|
|
2
|
+
import type { Form, FormValues } from '@devvit/shared-types/shared/form.js';
|
|
3
3
|
/**
|
|
4
4
|
* Response format that can be returned from menu action handlers and form handlers.
|
|
5
5
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui-response.d.ts","sourceRoot":"","sources":["../../src/types/ui-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"ui-response.d.ts","sourceRoot":"","sources":["../../src/types/ui-response.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AAE5E;;;;;GAKG;AACH,MAAM,MAAM,UAAU,CAAC,YAAY,SAAS,UAAU,GAAG,UAAU,IAAI;IACrE,wFAAwF;IACxF,UAAU,CAAC,EAAE,MAAM,GAAG;QAAE,GAAG,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,gDAAgD;IAChD,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,kDAAkD;IAClD,QAAQ,CAAC,EAAE;QACT,0EAA0E;QAC1E,IAAI,EAAE,MAAM,CAAC;QACb,wDAAwD;QACxD,IAAI,EAAE,IAAI,CAAC;QACX,kDAAkD;QAClD,IAAI,CAAC,EAAE,UAAU,CAAC,YAAY,CAAC,GAAG,SAAS,CAAC;KAC7C,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,yCAAyC;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,UAAU,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;CACpC,CAAC"}
|
package/types/form.d.ts
DELETED
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { FieldConfig_Boolean, FieldConfig_Number, FieldConfig_Paragraph, FieldConfig_Selection, FieldConfig_Selection_Item, FieldConfig_String } from '@devvit/protos';
|
|
2
|
-
import type { JsonObject } from '@devvit/shared-types/json.js';
|
|
3
|
-
import type { Prettify } from '@devvit/shared-types/Prettify.js';
|
|
4
|
-
export type FormValues<T extends JsonObject> = T;
|
|
5
|
-
export type FormRequest<T extends JsonObject> = T;
|
|
6
|
-
export type Form = {
|
|
7
|
-
/** The fields that will be displayed in the form */
|
|
8
|
-
fields: readonly FormField[];
|
|
9
|
-
/** An optional title for the form */
|
|
10
|
-
title?: string;
|
|
11
|
-
/** An optional description for the form */
|
|
12
|
-
description?: string;
|
|
13
|
-
/** An optional label for the submit button */
|
|
14
|
-
acceptLabel?: string;
|
|
15
|
-
/** An optional label for the cancel button */
|
|
16
|
-
cancelLabel?: string;
|
|
17
|
-
};
|
|
18
|
-
export type BaseField<ValueType> = {
|
|
19
|
-
/**
|
|
20
|
-
* The name of the field. This will be used as the key in the `values` object
|
|
21
|
-
* when the form is submitted.
|
|
22
|
-
*/
|
|
23
|
-
name: string;
|
|
24
|
-
/** The label of the field. This will be displayed to the user */
|
|
25
|
-
label: string;
|
|
26
|
-
/** An optional help text that will be displayed below the field */
|
|
27
|
-
helpText?: string | undefined;
|
|
28
|
-
/**
|
|
29
|
-
* If true the field will be required and the user will not be able to submit
|
|
30
|
-
* the form without filling it in.
|
|
31
|
-
*/
|
|
32
|
-
required?: boolean | undefined;
|
|
33
|
-
/** If true the field will be disabled */
|
|
34
|
-
disabled?: boolean | undefined;
|
|
35
|
-
/** The default value of the field */
|
|
36
|
-
defaultValue?: ValueType | undefined;
|
|
37
|
-
/**
|
|
38
|
-
* This indicates whether the field (setting) is an app level or install level
|
|
39
|
-
* setting. App setting values can be used by any installation.
|
|
40
|
-
*/
|
|
41
|
-
scope?: SettingScopeType | undefined;
|
|
42
|
-
};
|
|
43
|
-
export type SettingScopeType = 'installation' | 'app';
|
|
44
|
-
export declare enum SettingScope {
|
|
45
|
-
Installation = "installation",
|
|
46
|
-
App = "app"
|
|
47
|
-
}
|
|
48
|
-
/** A text field */
|
|
49
|
-
export type StringField = Prettify<BaseField<string> & Omit<FieldConfig_String, 'minLength' | 'maxLength'> & {
|
|
50
|
-
type: 'string';
|
|
51
|
-
isSecret?: boolean;
|
|
52
|
-
}>;
|
|
53
|
-
/**
|
|
54
|
-
* Allows a user to upload an image as part of submitting the form. The string value that's
|
|
55
|
-
* given back is the URL of the image.
|
|
56
|
-
* @experimental
|
|
57
|
-
*/
|
|
58
|
-
export type ImageField = Omit<BaseField<string>, 'defaultValue'> & {
|
|
59
|
-
type: 'image';
|
|
60
|
-
};
|
|
61
|
-
/** A paragraph or textarea field */
|
|
62
|
-
export type ParagraphField = Prettify<BaseField<string> & Omit<FieldConfig_Paragraph, 'maxCharacters'> & {
|
|
63
|
-
type: 'paragraph';
|
|
64
|
-
}>;
|
|
65
|
-
/** A number field */
|
|
66
|
-
export type NumberField = Prettify<BaseField<number> & Omit<FieldConfig_Number, 'min' | 'max' | 'step'> & {
|
|
67
|
-
type: 'number';
|
|
68
|
-
}>;
|
|
69
|
-
/** A boolean field displayed as a toggle */
|
|
70
|
-
export type BooleanField = Prettify<Omit<BaseField<boolean>, 'required'> & FieldConfig_Boolean & {
|
|
71
|
-
type: 'boolean';
|
|
72
|
-
}>;
|
|
73
|
-
/** A dropdown field that allows users to pick from a list of options */
|
|
74
|
-
export type SelectField = Prettify<BaseField<string[]> & Omit<FieldConfig_Selection, 'choices' | 'renderAsList' | 'minSelections' | 'maxSelections'> & {
|
|
75
|
-
type: 'select';
|
|
76
|
-
options: FieldConfig_Selection_Item[];
|
|
77
|
-
}>;
|
|
78
|
-
/** A grouping of fields */
|
|
79
|
-
export type FormFieldGroup = {
|
|
80
|
-
type: 'group';
|
|
81
|
-
/** The label of the group that will be displayed to the user */
|
|
82
|
-
label: string;
|
|
83
|
-
/** The fields that will be displayed in the group */
|
|
84
|
-
fields: FormField[];
|
|
85
|
-
/** An optional help text that will be displayed below the group */
|
|
86
|
-
helpText?: string | undefined;
|
|
87
|
-
required?: never;
|
|
88
|
-
};
|
|
89
|
-
export type FormField = StringField | ImageField | ParagraphField | NumberField | BooleanField | SelectField | FormFieldGroup;
|
|
90
|
-
//# sourceMappingURL=form.d.ts.map
|
package/types/form.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"form.d.ts","sourceRoot":"","sources":["../../src/types/form.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,mBAAmB,EACnB,kBAAkB,EAClB,qBAAqB,EACrB,qBAAqB,EACrB,0BAA0B,EAC1B,kBAAkB,EACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,kCAAkC,CAAC;AAGjE,MAAM,MAAM,UAAU,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,CAAC;AAGjD,MAAM,MAAM,WAAW,CAAC,CAAC,SAAS,UAAU,IAAI,CAAC,CAAC;AAElD,MAAM,MAAM,IAAI,GAAG;IACjB,oDAAoD;IACpD,MAAM,EAAE,SAAS,SAAS,EAAE,CAAC;IAC7B,qCAAqC;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8CAA8C;IAC9C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,SAAS,CAAC,SAAS,IAAI;IACjC;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,KAAK,EAAE,MAAM,CAAC;IACd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