Skip to content

Commit 2fefb14

Browse files
committed
refactor: unify SuperTokensPlugin type with web-js version for consistency
1 parent 4c7f06a commit 2fefb14

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

lib/build/types.d.ts

Lines changed: 2 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/ts/types.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ import type { CookieHandlerInput } from "supertokens-web-js/utils/cookieHandler/
4646
import type NormalisedURLDomain from "supertokens-web-js/utils/normalisedURLDomain";
4747
import type NormalisedURLPath from "supertokens-web-js/utils/normalisedURLPath";
4848
import type { WindowHandlerInput } from "supertokens-web-js/utils/windowHandler/types";
49+
import type { SuperTokensPlugin as SuperTokensPluginWebJS } from "supertokens-web-js";
4950

5051
type SuccessRedirectContextCommon = {
5152
recipeId:
@@ -531,12 +532,8 @@ export type PluginRouteHandler = {
531532
handler: () => JSX.Element;
532533
};
533534

534-
// TODO: this should probably derive from the web-js version
535-
export type SuperTokensPlugin = {
536-
id: string;
537-
version?: string;
535+
export type SuperTokensPlugin = SuperTokensPluginWebJS & {
538536
compatibleAuthReactSDKVersions?: string | string[]; // match the syntax of the engines field in package.json
539-
compatibleWebJSSDKVersions?: string | string[]; // match the syntax of the engines field in package.json
540537
init?: (config: SuperTokensPublicConfig, allPlugins: SuperTokensPublicPlugin[], sdkVersion: string) => void;
541538
dependencies?: (
542539
config: SuperTokensPublicConfig,
@@ -558,7 +555,6 @@ export type SuperTokensPlugin = {
558555
| PluginRouteHandler[];
559556

560557
config?: (config: SuperTokensPublicConfig) => Omit<SuperTokensPublicConfig, "appInfo"> | undefined;
561-
exports?: Record<string, any>;
562558
};
563559

564560
export const nonPublicConfigProperties = ["experimental"] as const;

0 commit comments

Comments
 (0)