@dressed/react 1.0.0 → 1.2.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/dist/index.d.ts +10 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import { type APIInteractionResponseCallbackData } from "discord-api-types/v10";
|
|
2
|
+
import { type APIInteractionResponseCallbackData, type APIModalInteractionResponseCallbackData } from "discord-api-types/v10";
|
|
3
3
|
import type { createInteraction, RawFile } from "dressed/server";
|
|
4
|
+
import type { CommandInteraction as DressedCommandInteraction, MessageComponentInteraction as DressedMessageComponentInteraction, ModalSubmitInteraction as DressedModalSubmitInteraction } from "dressed";
|
|
4
5
|
type ReplyProps = [
|
|
5
6
|
components: ReactNode,
|
|
6
7
|
data?: Omit<APIInteractionResponseCallbackData, "content"> & {
|
|
@@ -28,15 +29,23 @@ type FollowUpProps = [
|
|
|
28
29
|
ephemeral?: boolean;
|
|
29
30
|
}
|
|
30
31
|
];
|
|
32
|
+
type ShowModalProps = [
|
|
33
|
+
components: ReactNode,
|
|
34
|
+
data?: Omit<APIModalInteractionResponseCallbackData, "components">
|
|
35
|
+
];
|
|
31
36
|
type ReactivatedInteraction<T extends NonNullable<ReturnType<typeof createInteraction>>> = OverrideMethodParams<T, {
|
|
32
37
|
reply: ReplyProps;
|
|
33
38
|
editReply: EditReplyProps;
|
|
34
39
|
update: EditReplyProps;
|
|
35
40
|
followUp: FollowUpProps;
|
|
41
|
+
showModal: ShowModalProps;
|
|
36
42
|
}>;
|
|
37
43
|
type OverrideMethodParams<T, Overrides extends Record<string, unknown[]>> = {
|
|
38
44
|
[K in keyof T]: K extends keyof Overrides ? T[K] extends (...args: any) => any ? (...args: Overrides[K]) => ReturnType<T[K]> : T[K] : T[K];
|
|
39
45
|
};
|
|
46
|
+
export type CommandInteraction = ReactivatedInteraction<DressedCommandInteraction>;
|
|
47
|
+
export type MessageComponentInteraction = ReactivatedInteraction<DressedMessageComponentInteraction>;
|
|
48
|
+
export type ModalSubmitInteraction = ReactivatedInteraction<DressedModalSubmitInteraction>;
|
|
40
49
|
export declare function render(component: ReactNode): Promise<import("./react/renderer.ts").Renderer>;
|
|
41
50
|
export declare function patchInteraction<T extends NonNullable<ReturnType<typeof createInteraction>>>(interaction: T): ReactivatedInteraction<T>;
|
|
42
51
|
export { ActionRow } from "./components/action-row.ts";
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,YAAY,GAGb,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAqEnD,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,SAAoB;IAC/C,MAAM,SAAS,GAAG,cAAc,EAAE,CAAC;IACnC,MAAM,IAAI,GAAG,UAAU,CAAC,eAAe,CACrC,SAAS,EACT,CAAC,EACD,IAAI,EACJ,KAAK,EACL,IAAI,EACJ,SAAS,EACT,CAAC,KAAY,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,EACtC,IAAI,CACL,CAAC;IAEF,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;QAClB,MAAM,IAAI,OAAO,CAAO,CAAC,CAAC,EAAE,EAAE,CAC5B,UAAU,CAAC,eAAe,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CACrD,CAAC;QACF,MAAM,SAAS,CAAC,MAAM,EAAE,CAAC;IAC3B,CAAC;IACD,OAAO,SAAS,CAAC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EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dressed/react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/Inbestigator/dressed.git",
|
|
@@ -31,11 +31,11 @@
|
|
|
31
31
|
"type": "module",
|
|
32
32
|
"types": "./dist/index.d.ts",
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"discord-api-types": "^0.38.
|
|
34
|
+
"discord-api-types": "^0.38.11",
|
|
35
35
|
"react-reconciler": "github:inbestigator/dressed-rr"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@types/react": "^19.1.
|
|
38
|
+
"@types/react": "^19.1.8",
|
|
39
39
|
"@types/react-reconciler": "^0.32.0"
|
|
40
40
|
}
|
|
41
41
|
}
|