@clicktap/state 0.16.3 → 0.16.4
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/__mocks__/nanoid.d.ts +1 -1
- package/auth/AuthProvider.d.ts +102 -224
- package/auth/actors/authenticate.d.ts +1 -1
- package/auth/actors/refreshAccessToken.d.ts +1 -1
- package/auth/actors/unauthenticate.d.ts +1 -1
- package/auth/auth.d.ts +51 -112
- package/index.js +41 -34
- package/index.mjs +1979 -1636
- package/package.json +2 -2
- package/quote/CheckoutProvider.d.ts +103 -220
- package/quote/QuoteProvider.d.ts +175 -424
- package/quote/checkout/actions/resetCheckout.d.ts +23 -23
- package/quote/checkout/actions/updateQuote.d.ts +37 -37
- package/quote/checkout/actors/placeOrder.d.ts +1 -1
- package/quote/checkout/actors/submitStepData.d.ts +1 -1
- package/quote/checkout.d.ts +39 -78
- package/quote/quote/actions/addItems.d.ts +37 -37
- package/quote/quote/actions/refresh.d.ts +37 -37
- package/quote/quote/actions/removeItems.d.ts +37 -37
- package/quote/quote/actions/syncAccessToken.d.ts +12 -12
- package/quote/quote/actions/updateItems.d.ts +37 -37
- package/quote/quote/actors/addItems.d.ts +1 -1
- package/quote/quote/actors/refresh.d.ts +1 -1
- package/quote/quote/actors/removeItems.d.ts +1 -1
- package/quote/quote/actors/updateItems.d.ts +1 -1
- package/quote/quote.d.ts +68 -151
- package/toast/ToastProvider.d.ts +45 -58
- package/toast/timer.d.ts +12 -11
- package/toast/toast.d.ts +45 -58
package/quote/quote.d.ts
CHANGED
|
@@ -1,155 +1,72 @@
|
|
|
1
1
|
import { DeepPartial } from './types';
|
|
2
2
|
import { QuoteMachineContext } from './quote/types';
|
|
3
|
-
export declare const quoteMachine: import('xstate').StateMachine<QuoteMachineContext, import('./quote/types').SetQuoteEmptyEvent | import('./quote/types').SetQuoteActiveEvent | import('./quote/types').AddItemsEvent | import('./quote/types').RemoveItemsEvent | import('./quote/types').UpdateItemsEvent | import('./quote/types').ClearItemsEvent | import('./quote/types').RefreshEvent | import('./quote/types').ResetEvent | import('./quote/types').ApplyPromotionEvent | import('./quote/types').RemovePromotionEvent | import('./quote/types').AddAddressEvent | import('./quote/types').RemoveAddressEvent | import('./quote/types').ApplyPaymentMethodEvent | import('./quote/types').AddRewardEvent | import('./quote/types').RemoveRewardEvent | import('./quote/types').AddStoreCreditEvent | import('./quote/types').RemoveStoreCreditEvent | import('./quote/types').AddGiftCardEvent | import('./quote/types').RemoveGiftCardEvent | import('./quote/types').SyncAccessTokenEvent | import('xstate').DoneActorEvent<import('./quote/types').AddItemsSuccessEvent> | import('xstate').DoneActorEvent<import('./quote/types').RemoveItemsSuccessEvent> | import('xstate').DoneActorEvent<import('./quote/types').UpdateItemsSuccessEvent> | import('xstate').DoneActorEvent<import('./quote/types').ClearItemsSuccessEvent> | import('xstate').DoneActorEvent<import('./quote/types').RefreshSuccessEvent>, {
|
|
4
|
-
[x: string]: import('xstate').
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
notifyAddItems: {
|
|
56
|
-
type: "notifyAddItems";
|
|
57
|
-
params: import('xstate').NonReducibleUnknown;
|
|
58
|
-
};
|
|
59
|
-
notifyRemoveItems: {
|
|
60
|
-
type: "notifyRemoveItems";
|
|
61
|
-
params: import('xstate').NonReducibleUnknown;
|
|
62
|
-
};
|
|
63
|
-
notifyUpdateItems: {
|
|
64
|
-
type: "notifyUpdateItems";
|
|
65
|
-
params: import('xstate').NonReducibleUnknown;
|
|
66
|
-
};
|
|
67
|
-
reset: {
|
|
68
|
-
type: "reset";
|
|
69
|
-
params: import('xstate').NonReducibleUnknown;
|
|
70
|
-
};
|
|
71
|
-
syncAccessToken: {
|
|
72
|
-
type: "syncAccessToken";
|
|
73
|
-
params: import('xstate').NonReducibleUnknown;
|
|
74
|
-
};
|
|
75
|
-
}>, import('xstate').Values<{
|
|
76
|
-
canRefresh: {
|
|
77
|
-
type: "canRefresh";
|
|
78
|
-
params: unknown;
|
|
79
|
-
};
|
|
80
|
-
hasItems: {
|
|
81
|
-
type: "hasItems";
|
|
82
|
-
params: unknown;
|
|
83
|
-
};
|
|
84
|
-
}>, never, "active" | "refreshing" | "uninitialized" | "initializing" | "empty" | "addingItems" | "updatingItems" | "removingItems" | "resetting" | "checkingItems", string, {
|
|
3
|
+
export declare const quoteMachine: import('xstate').StateMachine<QuoteMachineContext, import('./quote/types').SetQuoteEmptyEvent | import('./quote/types').SetQuoteActiveEvent | import('./quote/types').AddItemsEvent | import('./quote/types').RemoveItemsEvent | import('./quote/types').UpdateItemsEvent | import('./quote/types').ClearItemsEvent | import('./quote/types').RefreshEvent | import('./quote/types').ResetEvent | import('./quote/types').ApplyPromotionEvent | import('./quote/types').RemovePromotionEvent | import('./quote/types').AddAddressEvent | import('./quote/types').RemoveAddressEvent | import('./quote/types').ApplyPaymentMethodEvent | import('./quote/types').AddRewardEvent | import('./quote/types').RemoveRewardEvent | import('./quote/types').AddStoreCreditEvent | import('./quote/types').RemoveStoreCreditEvent | import('./quote/types').AddGiftCardEvent | import('./quote/types').RemoveGiftCardEvent | import('./quote/types').SyncAccessTokenEvent | import('xstate').DoneActorEvent<import('./quote/types').AddItemsSuccessEvent, string> | import('xstate').DoneActorEvent<import('./quote/types').RemoveItemsSuccessEvent, string> | import('xstate').DoneActorEvent<import('./quote/types').UpdateItemsSuccessEvent, string> | import('xstate').DoneActorEvent<import('./quote/types').ClearItemsSuccessEvent, string> | import('xstate').DoneActorEvent<import('./quote/types').RefreshSuccessEvent, string>, {
|
|
4
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./quote/types').RefreshSuccessEvent, import('./quote/actors').RefreshInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./quote/types').AddItemsSuccessEvent, import('./quote/actors').AddItemsInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./quote/types').RemoveItemsSuccessEvent, import('./quote/actors').RemoveItemsInput, import('xstate').EventObject>> | import('xstate').ActorRefFromLogic<import('xstate').PromiseActorLogic<import('./quote/types').UpdateItemsSuccessEvent, import('./quote/actors').UpdateItemsInput, import('xstate').EventObject>> | undefined;
|
|
5
|
+
}, {
|
|
6
|
+
src: "refresh";
|
|
7
|
+
logic: import('xstate').PromiseActorLogic<import('./quote/types').RefreshSuccessEvent, import('./quote/actors').RefreshInput, import('xstate').EventObject>;
|
|
8
|
+
id: string | undefined;
|
|
9
|
+
} | {
|
|
10
|
+
src: "addItems";
|
|
11
|
+
logic: import('xstate').PromiseActorLogic<import('./quote/types').AddItemsSuccessEvent, import('./quote/actors').AddItemsInput, import('xstate').EventObject>;
|
|
12
|
+
id: string | undefined;
|
|
13
|
+
} | {
|
|
14
|
+
src: "removeItems";
|
|
15
|
+
logic: import('xstate').PromiseActorLogic<import('./quote/types').RemoveItemsSuccessEvent, import('./quote/actors').RemoveItemsInput, import('xstate').EventObject>;
|
|
16
|
+
id: string | undefined;
|
|
17
|
+
} | {
|
|
18
|
+
src: "updateItems";
|
|
19
|
+
logic: import('xstate').PromiseActorLogic<import('./quote/types').UpdateItemsSuccessEvent, import('./quote/actors').UpdateItemsInput, import('xstate').EventObject>;
|
|
20
|
+
id: string | undefined;
|
|
21
|
+
}, {
|
|
22
|
+
type: "refresh";
|
|
23
|
+
params: import('xstate').NonReducibleUnknown;
|
|
24
|
+
} | {
|
|
25
|
+
type: "addItems";
|
|
26
|
+
params: import('xstate').NonReducibleUnknown;
|
|
27
|
+
} | {
|
|
28
|
+
type: "removeItems";
|
|
29
|
+
params: import('xstate').NonReducibleUnknown;
|
|
30
|
+
} | {
|
|
31
|
+
type: "updateItems";
|
|
32
|
+
params: import('xstate').NonReducibleUnknown;
|
|
33
|
+
} | {
|
|
34
|
+
type: "notifyAddItems";
|
|
35
|
+
params: import('xstate').NonReducibleUnknown;
|
|
36
|
+
} | {
|
|
37
|
+
type: "notifyRemoveItems";
|
|
38
|
+
params: import('xstate').NonReducibleUnknown;
|
|
39
|
+
} | {
|
|
40
|
+
type: "notifyUpdateItems";
|
|
41
|
+
params: import('xstate').NonReducibleUnknown;
|
|
42
|
+
} | {
|
|
43
|
+
type: "reset";
|
|
44
|
+
params: import('xstate').NonReducibleUnknown;
|
|
45
|
+
} | {
|
|
46
|
+
type: "syncAccessToken";
|
|
47
|
+
params: import('xstate').NonReducibleUnknown;
|
|
48
|
+
}, {
|
|
49
|
+
type: "canRefresh";
|
|
50
|
+
params: unknown;
|
|
51
|
+
} | {
|
|
52
|
+
type: "hasItems";
|
|
53
|
+
params: unknown;
|
|
54
|
+
}, never, "active" | "refreshing" | "uninitialized" | "initializing" | "empty" | "addingItems" | "updatingItems" | "removingItems" | "resetting" | "checkingItems", string, {
|
|
85
55
|
initialContext: DeepPartial<QuoteMachineContext>;
|
|
86
|
-
initialState?: string
|
|
87
|
-
}, import('xstate').NonReducibleUnknown, import('./quote/types').AddItemsEmittedEvent | import('./quote/types').RemoveItemsEmittedEvent | import('./quote/types').UpdateItemsEmittedEvent, import('xstate').MetaObject,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
};
|
|
103
|
-
updateItems: {
|
|
104
|
-
src: "updateItems";
|
|
105
|
-
logic: import('xstate').PromiseActorLogic<import('./quote/types').UpdateItemsSuccessEvent, import('./quote/actors').UpdateItemsInput>;
|
|
106
|
-
id: string | undefined;
|
|
107
|
-
};
|
|
108
|
-
}>, import('xstate').Values<{
|
|
109
|
-
refresh: {
|
|
110
|
-
type: "refresh";
|
|
111
|
-
params: import('xstate').NonReducibleUnknown;
|
|
112
|
-
};
|
|
113
|
-
addItems: {
|
|
114
|
-
type: "addItems";
|
|
115
|
-
params: import('xstate').NonReducibleUnknown;
|
|
116
|
-
};
|
|
117
|
-
removeItems: {
|
|
118
|
-
type: "removeItems";
|
|
119
|
-
params: import('xstate').NonReducibleUnknown;
|
|
120
|
-
};
|
|
121
|
-
updateItems: {
|
|
122
|
-
type: "updateItems";
|
|
123
|
-
params: import('xstate').NonReducibleUnknown;
|
|
124
|
-
};
|
|
125
|
-
notifyAddItems: {
|
|
126
|
-
type: "notifyAddItems";
|
|
127
|
-
params: import('xstate').NonReducibleUnknown;
|
|
128
|
-
};
|
|
129
|
-
notifyRemoveItems: {
|
|
130
|
-
type: "notifyRemoveItems";
|
|
131
|
-
params: import('xstate').NonReducibleUnknown;
|
|
132
|
-
};
|
|
133
|
-
notifyUpdateItems: {
|
|
134
|
-
type: "notifyUpdateItems";
|
|
135
|
-
params: import('xstate').NonReducibleUnknown;
|
|
136
|
-
};
|
|
137
|
-
reset: {
|
|
138
|
-
type: "reset";
|
|
139
|
-
params: import('xstate').NonReducibleUnknown;
|
|
140
|
-
};
|
|
141
|
-
syncAccessToken: {
|
|
142
|
-
type: "syncAccessToken";
|
|
143
|
-
params: import('xstate').NonReducibleUnknown;
|
|
144
|
-
};
|
|
145
|
-
}>, import('xstate').Values<{
|
|
146
|
-
canRefresh: {
|
|
147
|
-
type: "canRefresh";
|
|
148
|
-
params: unknown;
|
|
149
|
-
};
|
|
150
|
-
hasItems: {
|
|
151
|
-
type: "hasItems";
|
|
152
|
-
params: unknown;
|
|
153
|
-
};
|
|
154
|
-
}>, never, string, import('./quote/types').AddItemsEmittedEvent | import('./quote/types').RemoveItemsEmittedEvent | import('./quote/types').UpdateItemsEmittedEvent>>;
|
|
56
|
+
initialState?: string;
|
|
57
|
+
}, import('xstate').NonReducibleUnknown, import('./quote/types').AddItemsEmittedEvent | import('./quote/types').RemoveItemsEmittedEvent | import('./quote/types').UpdateItemsEmittedEvent, import('xstate').MetaObject, {
|
|
58
|
+
id: "quote";
|
|
59
|
+
states: {
|
|
60
|
+
readonly uninitialized: {};
|
|
61
|
+
readonly empty: {};
|
|
62
|
+
readonly active: {};
|
|
63
|
+
readonly initializing: {};
|
|
64
|
+
readonly refreshing: {};
|
|
65
|
+
readonly checkingItems: {};
|
|
66
|
+
readonly addingItems: {};
|
|
67
|
+
readonly removingItems: {};
|
|
68
|
+
readonly updatingItems: {};
|
|
69
|
+
readonly resetting: {};
|
|
70
|
+
};
|
|
71
|
+
}>;
|
|
155
72
|
export default quoteMachine;
|
package/toast/ToastProvider.d.ts
CHANGED
|
@@ -5,85 +5,72 @@ export interface ToastContextType {
|
|
|
5
5
|
toastActor: Actor<typeof toastMachine>;
|
|
6
6
|
}
|
|
7
7
|
export declare const ToastContext: import('react').Context<Actor<import('xstate').StateMachine<import('./types').ToastMachineContext, import('./types').AddItemEvent | import('./types').RemoveItemEvent | import('./types').SetToastIdleEvent | import('./types').SetToastActiveEvent | import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').TimerDoneEvent, {
|
|
8
|
-
[x: string]: import('xstate').
|
|
9
|
-
[x: string]: import('xstate').
|
|
8
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').StateMachine<import('./types').TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
9
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
10
10
|
interval: number;
|
|
11
|
-
}
|
|
12
|
-
}, "running" | "paused" | "completed", string, import('xstate').NonReducibleUnknown, import('xstate').MetaObject>, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, import('xstate').EventObject> | undefined;
|
|
13
|
-
}, {
|
|
14
|
-
src: "timer";
|
|
15
|
-
logic: import('xstate').StateMachine<import('./types').TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
16
|
-
[x: string]: import('xstate').ActorRef<import('xstate').CallbackSnapshot<{
|
|
17
|
-
interval: number;
|
|
18
|
-
}>, import('./types').TimerTickEvent, import('xstate').EventObject> | undefined;
|
|
11
|
+
}, import('xstate').EventObject>> | undefined;
|
|
19
12
|
}, {
|
|
20
13
|
src: "tick";
|
|
21
14
|
logic: import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
22
15
|
interval: number;
|
|
23
|
-
}>;
|
|
16
|
+
}, import('xstate').EventObject>;
|
|
24
17
|
id: string | undefined;
|
|
25
18
|
}, never, never, never, "running" | "paused" | "completed", string, {
|
|
26
19
|
initialContext: Partial<import('./types').TimerContext>;
|
|
27
|
-
initialState?: string
|
|
28
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
},
|
|
37
|
-
addItem: {
|
|
38
|
-
type: "addItem";
|
|
39
|
-
params: import('xstate').NonReducibleUnknown;
|
|
40
|
-
};
|
|
41
|
-
removeItem: {
|
|
42
|
-
type: "removeItem";
|
|
43
|
-
params: import('xstate').NonReducibleUnknown;
|
|
44
|
-
};
|
|
45
|
-
}>, {
|
|
46
|
-
type: "itemHasTimeout";
|
|
47
|
-
params: unknown;
|
|
48
|
-
}, "ITEM_TIMEOUT", "active" | "idle" | "adding" | "removing", string, {
|
|
49
|
-
initialContext: Partial<import('./types').ToastMachineContext>;
|
|
50
|
-
initialState?: string | undefined;
|
|
51
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, import('xstate').ResolveTypegenMeta<import('xstate').TypegenDisabled, import('./types').AddItemEvent | import('./types').RemoveItemEvent | import('./types').SetToastIdleEvent | import('./types').SetToastActiveEvent | import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').TimerDoneEvent, {
|
|
20
|
+
initialState?: string;
|
|
21
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
22
|
+
id: "timer";
|
|
23
|
+
states: {
|
|
24
|
+
readonly paused: {};
|
|
25
|
+
readonly running: {};
|
|
26
|
+
readonly completed: {};
|
|
27
|
+
};
|
|
28
|
+
}>> | undefined;
|
|
29
|
+
}, {
|
|
52
30
|
src: "timer";
|
|
53
31
|
logic: import('xstate').StateMachine<import('./types').TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
54
|
-
[x: string]: import('xstate').
|
|
32
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
55
33
|
interval: number;
|
|
56
|
-
}
|
|
34
|
+
}, import('xstate').EventObject>> | undefined;
|
|
57
35
|
}, {
|
|
58
36
|
src: "tick";
|
|
59
37
|
logic: import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
60
38
|
interval: number;
|
|
61
|
-
}>;
|
|
39
|
+
}, import('xstate').EventObject>;
|
|
62
40
|
id: string | undefined;
|
|
63
41
|
}, never, never, never, "running" | "paused" | "completed", string, {
|
|
64
42
|
initialContext: Partial<import('./types').TimerContext>;
|
|
65
|
-
initialState?: string
|
|
66
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
43
|
+
initialState?: string;
|
|
44
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
45
|
+
id: "timer";
|
|
46
|
+
states: {
|
|
47
|
+
readonly paused: {};
|
|
48
|
+
readonly running: {};
|
|
49
|
+
readonly completed: {};
|
|
50
|
+
};
|
|
51
|
+
}>;
|
|
73
52
|
id: string | undefined;
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
params: import('xstate').NonReducibleUnknown;
|
|
82
|
-
};
|
|
83
|
-
}>, {
|
|
53
|
+
}, {
|
|
54
|
+
type: "addItem";
|
|
55
|
+
params: import('xstate').NonReducibleUnknown;
|
|
56
|
+
} | {
|
|
57
|
+
type: "removeItem";
|
|
58
|
+
params: import('xstate').NonReducibleUnknown;
|
|
59
|
+
}, {
|
|
84
60
|
type: "itemHasTimeout";
|
|
85
61
|
params: unknown;
|
|
86
|
-
}, "ITEM_TIMEOUT", string,
|
|
62
|
+
}, "ITEM_TIMEOUT", "active" | "idle" | "adding" | "removing", string, {
|
|
63
|
+
initialContext: Partial<import('./types').ToastMachineContext>;
|
|
64
|
+
initialState?: string;
|
|
65
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
66
|
+
id: "toast";
|
|
67
|
+
states: {
|
|
68
|
+
readonly idle: {};
|
|
69
|
+
readonly active: {};
|
|
70
|
+
readonly adding: {};
|
|
71
|
+
readonly removing: {};
|
|
72
|
+
};
|
|
73
|
+
}>>>;
|
|
87
74
|
export declare const useToast: () => ToastContextType;
|
|
88
75
|
type Props = {
|
|
89
76
|
children: ReactNode;
|
package/toast/timer.d.ts
CHANGED
|
@@ -1,22 +1,23 @@
|
|
|
1
1
|
import { TimerContext, TimerTickEvent } from './types';
|
|
2
2
|
export declare const timerMachine: import('xstate').StateMachine<TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
3
|
-
[x: string]: import('xstate').
|
|
3
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<TimerTickEvent, {
|
|
4
4
|
interval: number;
|
|
5
|
-
}
|
|
5
|
+
}, import('xstate').EventObject>> | undefined;
|
|
6
6
|
}, {
|
|
7
7
|
src: "tick";
|
|
8
8
|
logic: import('xstate').CallbackActorLogic<TimerTickEvent, {
|
|
9
9
|
interval: number;
|
|
10
|
-
}>;
|
|
10
|
+
}, import('xstate').EventObject>;
|
|
11
11
|
id: string | undefined;
|
|
12
12
|
}, never, never, never, "running" | "paused" | "completed", string, {
|
|
13
13
|
initialContext: Partial<TimerContext>;
|
|
14
|
-
initialState?: string
|
|
15
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
14
|
+
initialState?: string;
|
|
15
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
16
|
+
id: "timer";
|
|
17
|
+
states: {
|
|
18
|
+
readonly paused: {};
|
|
19
|
+
readonly running: {};
|
|
20
|
+
readonly completed: {};
|
|
21
|
+
};
|
|
22
|
+
}>;
|
|
22
23
|
export default timerMachine;
|
package/toast/toast.d.ts
CHANGED
|
@@ -1,82 +1,69 @@
|
|
|
1
1
|
import { ToastMachineContext } from './types';
|
|
2
2
|
export declare const toastMachine: import('xstate').StateMachine<ToastMachineContext, import('./types').AddItemEvent | import('./types').RemoveItemEvent | import('./types').SetToastIdleEvent | import('./types').SetToastActiveEvent | import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').TimerDoneEvent, {
|
|
3
|
-
[x: string]: import('xstate').
|
|
4
|
-
[x: string]: import('xstate').
|
|
3
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').StateMachine<import('./types').TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
4
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
5
5
|
interval: number;
|
|
6
|
-
}
|
|
7
|
-
}, "running" | "paused" | "completed", string, import('xstate').NonReducibleUnknown, import('xstate').MetaObject>, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, import('xstate').EventObject> | undefined;
|
|
8
|
-
}, {
|
|
9
|
-
src: "timer";
|
|
10
|
-
logic: import('xstate').StateMachine<import('./types').TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
11
|
-
[x: string]: import('xstate').ActorRef<import('xstate').CallbackSnapshot<{
|
|
12
|
-
interval: number;
|
|
13
|
-
}>, import('./types').TimerTickEvent, import('xstate').EventObject> | undefined;
|
|
6
|
+
}, import('xstate').EventObject>> | undefined;
|
|
14
7
|
}, {
|
|
15
8
|
src: "tick";
|
|
16
9
|
logic: import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
17
10
|
interval: number;
|
|
18
|
-
}>;
|
|
11
|
+
}, import('xstate').EventObject>;
|
|
19
12
|
id: string | undefined;
|
|
20
13
|
}, never, never, never, "running" | "paused" | "completed", string, {
|
|
21
14
|
initialContext: Partial<import('./types').TimerContext>;
|
|
22
|
-
initialState?: string
|
|
23
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
32
|
-
addItem: {
|
|
33
|
-
type: "addItem";
|
|
34
|
-
params: import('xstate').NonReducibleUnknown;
|
|
35
|
-
};
|
|
36
|
-
removeItem: {
|
|
37
|
-
type: "removeItem";
|
|
38
|
-
params: import('xstate').NonReducibleUnknown;
|
|
39
|
-
};
|
|
40
|
-
}>, {
|
|
41
|
-
type: "itemHasTimeout";
|
|
42
|
-
params: unknown;
|
|
43
|
-
}, "ITEM_TIMEOUT", "active" | "idle" | "adding" | "removing", string, {
|
|
44
|
-
initialContext: Partial<ToastMachineContext>;
|
|
45
|
-
initialState?: string | undefined;
|
|
46
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, import('xstate').ResolveTypegenMeta<import('xstate').TypegenDisabled, import('./types').AddItemEvent | import('./types').RemoveItemEvent | import('./types').SetToastIdleEvent | import('./types').SetToastActiveEvent | import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').TimerDoneEvent, {
|
|
15
|
+
initialState?: string;
|
|
16
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
17
|
+
id: "timer";
|
|
18
|
+
states: {
|
|
19
|
+
readonly paused: {};
|
|
20
|
+
readonly running: {};
|
|
21
|
+
readonly completed: {};
|
|
22
|
+
};
|
|
23
|
+
}>> | undefined;
|
|
24
|
+
}, {
|
|
47
25
|
src: "timer";
|
|
48
26
|
logic: import('xstate').StateMachine<import('./types').TimerContext, import('./types').ResumeTimerEvent | import('./types').PauseTimerEvent | import('./types').StartTimerEvent | import('./types').TimerTickEvent | import('./types').TimerDurationUpdateEvent | import('./types').ResetTimerEvent, {
|
|
49
|
-
[x: string]: import('xstate').
|
|
27
|
+
[x: string]: import('xstate').ActorRefFromLogic<import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
50
28
|
interval: number;
|
|
51
|
-
}
|
|
29
|
+
}, import('xstate').EventObject>> | undefined;
|
|
52
30
|
}, {
|
|
53
31
|
src: "tick";
|
|
54
32
|
logic: import('xstate').CallbackActorLogic<import('./types').TimerTickEvent, {
|
|
55
33
|
interval: number;
|
|
56
|
-
}>;
|
|
34
|
+
}, import('xstate').EventObject>;
|
|
57
35
|
id: string | undefined;
|
|
58
36
|
}, never, never, never, "running" | "paused" | "completed", string, {
|
|
59
37
|
initialContext: Partial<import('./types').TimerContext>;
|
|
60
|
-
initialState?: string
|
|
61
|
-
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
38
|
+
initialState?: string;
|
|
39
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
40
|
+
id: "timer";
|
|
41
|
+
states: {
|
|
42
|
+
readonly paused: {};
|
|
43
|
+
readonly running: {};
|
|
44
|
+
readonly completed: {};
|
|
45
|
+
};
|
|
46
|
+
}>;
|
|
68
47
|
id: string | undefined;
|
|
69
|
-
},
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
params: import('xstate').NonReducibleUnknown;
|
|
77
|
-
};
|
|
78
|
-
}>, {
|
|
48
|
+
}, {
|
|
49
|
+
type: "addItem";
|
|
50
|
+
params: import('xstate').NonReducibleUnknown;
|
|
51
|
+
} | {
|
|
52
|
+
type: "removeItem";
|
|
53
|
+
params: import('xstate').NonReducibleUnknown;
|
|
54
|
+
}, {
|
|
79
55
|
type: "itemHasTimeout";
|
|
80
56
|
params: unknown;
|
|
81
|
-
}, "ITEM_TIMEOUT", string,
|
|
57
|
+
}, "ITEM_TIMEOUT", "active" | "idle" | "adding" | "removing", string, {
|
|
58
|
+
initialContext: Partial<ToastMachineContext>;
|
|
59
|
+
initialState?: string;
|
|
60
|
+
}, import('xstate').NonReducibleUnknown, import('xstate').EventObject, import('xstate').MetaObject, {
|
|
61
|
+
id: "toast";
|
|
62
|
+
states: {
|
|
63
|
+
readonly idle: {};
|
|
64
|
+
readonly active: {};
|
|
65
|
+
readonly adding: {};
|
|
66
|
+
readonly removing: {};
|
|
67
|
+
};
|
|
68
|
+
}>;
|
|
82
69
|
export default toastMachine;
|