-
Notifications
You must be signed in to change notification settings - Fork 5
/
styleq.js.flow
38 lines (31 loc) · 966 Bytes
/
styleq.js.flow
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
30
31
32
33
34
35
36
37
38
/**
* Copyright (c) Nicolas Gallagher
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/
export type CompiledStyle = {
$$css: true,
[key: string]: string,
};
export type InlineStyle = {
$$css?: empty,
[key: string]: number | string,
};
export type EitherStyle = CompiledStyle | InlineStyle;
export type StylesArray<+T> = T | $ReadOnlyArray<StylesArray<T>>;
export type Styles = StylesArray<EitherStyle | false | void>;
export type Style<+T = EitherStyle> = StylesArray<false | ?T>;
export type StyleqOptions = {
disableCache?: boolean,
disableMix?: boolean,
transform?: (EitherStyle) => EitherStyle,
};
export type StyleqResult = [string, InlineStyle | null];
export type Styleq = (styles: Styles) => StyleqResult;
export type IStyleq = {
(...styles: $ReadOnlyArray<Styles>): StyleqResult,
factory: (options?: StyleqOptions) => Styleq,
};