@icanbwell/types 0.33.0 → 0.33.1

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.
@@ -1 +1,3 @@
1
+ const OnAuthSuccessEventKey = 'onauthsuccess';
1
2
 
3
+ export { OnAuthSuccessEventKey };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@icanbwell/types",
3
- "version": "0.33.0",
3
+ "version": "0.33.1",
4
4
  "typedoc": {
5
5
  "entryPoint": "./src/index.ts",
6
6
  "tsconfig": "./tsconfig.lib.json"
@@ -1,6 +1,20 @@
1
+ export type OnAuthSuccessEventData = {
2
+ user: {
3
+ id: string;
4
+ };
5
+ };
6
+ export declare const OnAuthSuccessEventKey = "onauthsuccess";
7
+ export type EventKeyToDataMap = {
8
+ [OnAuthSuccessEventKey]: OnAuthSuccessEventData;
9
+ };
10
+ type OnEventData<T extends keyof EventKeyToDataMap> = {
11
+ key: T;
12
+ data: EventKeyToDataMap[T];
13
+ };
1
14
  export type ComponentViewBaseProps = {
2
15
  clientKey: string;
3
16
  initialPath?: string;
17
+ onEvent: <T extends keyof EventKeyToDataMap>(data: OnEventData<T>) => void;
4
18
  } & ({
5
19
  /** Supply the auth strategy. Defaults to `jwe` which will require a `userToken` prop.
6
20
  *
@@ -11,3 +25,4 @@ export type ComponentViewBaseProps = {
11
25
  authStrategy: 'credential';
12
26
  userToken?: never;
13
27
  });
28
+ export {};