-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.d.ts
29 lines (24 loc) · 926 Bytes
/
index.d.ts
1
2
3
4
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
import * as React from "react"
/**
* All standard components exposed by `backoffice` are `StyledComponents` with
* certain `classes`, on which one can also set a top-level `className` and inline
* `style`.
*/
export type StandardProps<C, ClassKey extends string, Removals extends keyof C = never> = Omit<
C & { classes: any },
"classes" | Removals
> &
IStyledComponentProps<ClassKey> & {
className?: string
style?: Partial<React.CSSProperties>,
}
export type ClassNameMap<ClassKey extends string = string> = Record<ClassKey, string>
export interface IStyledComponentProps<ClassKey extends string = string> {
classes?: Partial<ClassNameMap<ClassKey>>
innerRef?: React.Ref<any>
}
/** @internal */
type Diff<T extends string, U extends string> = ({[P in T]: P } &
{[P in U]: never } & { [x: string]: never })[T]
/** @internal */
export type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>