Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,19 +120,17 @@ export type HOCDeclaration<Props> =
| DataKey
| ((props: Props) => Record<DataKey, ExpandedHOCDeclaration>);

export interface InferableComponentEnhancerWithProps<TNeedsProps, TInferProps> {
<P extends TInferProps>(component: React.ComponentType<P>): React.ComponentClass<
Omit<P, keyof TInferProps> & TNeedsProps
>;
}
export type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> = <P extends TInjectedProps>(
component: React.ComponentType<P>,
) => React.ComponentType<Omit<P, keyof TInjectedProps> & TNeedsProps>;

export class DenormalizationCache {}

export type HOCProps = {
nion: { [dataKey: string]: NionValue<any> };
};

declare function nion<Props>(
declare function nion<Props = {}>(
...declarations: [HOCDeclaration<Props>, ...Array<HOCDeclaration<Props>>]
): InferableComponentEnhancerWithProps<Props, HOCProps>;
): InferableComponentEnhancerWithProps<HOCProps, Props>;
export default nion;