@@ -22,13 +22,9 @@ export interface InPageChannelProtocol {
2222 sharedStates ?: Record < string , object >
2323}
2424
25- type SideFunctions < P , S > = InPageChannelProtocol extends P
26- ? Record < string , ( ...args : any [ ] ) => any >
27- : S extends Record < string , ( ...args : any [ ] ) => any >
28- ? string extends keyof S ? Record < never , never > : S
29- : Record < never , never >
30- type PageScriptFunctions < P extends InPageChannelProtocol > = SideFunctions < P , NonNullable < P [ 'pageScript' ] > >
31- type PanelFunctions < P extends InPageChannelProtocol > = SideFunctions < P , NonNullable < P [ 'panel' ] > >
25+ type SideFunctions < S > = S extends Record < string , ( ...args : any [ ] ) => any > ? S : Record < string , never >
26+ type PageScriptFunctions < P extends InPageChannelProtocol > = SideFunctions < NonNullable < P [ 'pageScript' ] > >
27+ type PanelFunctions < P extends InPageChannelProtocol > = SideFunctions < NonNullable < P [ 'panel' ] > >
3228type SharedStates < P extends InPageChannelProtocol >
3329 = P [ 'sharedStates' ] extends Record < string , object > ? P [ 'sharedStates' ] : Record < string , never >
3430
@@ -117,9 +113,7 @@ interface InPageFunctionOption<F> {
117113 */
118114type CreatePageScriptChannelOptionsFunctions < P extends InPageChannelProtocol > = {
119115 [ NAME in keyof PageScriptFunctions < P > & string ] : InPageFunctionOption < PageScriptFunctions < P > [ NAME ] >
120- } extends infer FUNCTIONS
121- ? keyof FUNCTIONS extends never ? Record < string , never > : FUNCTIONS
122- : never
116+ }
123117
124118/**
125119 * Functions implemented by {@link connectPanelChannel}.
@@ -128,9 +122,7 @@ type CreatePageScriptChannelOptionsFunctions<P extends InPageChannelProtocol> =
128122 */
129123type ConnectPanelChannelOptionsFunctions < P extends InPageChannelProtocol > = {
130124 [ NAME in keyof PanelFunctions < P > & string ] : InPageFunctionOption < PanelFunctions < P > [ NAME ] >
131- } extends infer FUNCTIONS
132- ? keyof FUNCTIONS extends never ? Record < string , never > : FUNCTIONS
133- : never
125+ }
134126
135127/**
136128 * Connection lifecycle of a panel endpoint: `connecting` (handshake retry
0 commit comments