Skip to content

Instantly share code, notes, and snippets.

@zgotsch
Created November 1, 2017 23:42
Show Gist options
  • Save zgotsch/d64e8e477f42febd3f67596628d04ed4 to your computer and use it in GitHub Desktop.
Save zgotsch/d64e8e477f42febd3f67596628d04ed4 to your computer and use it in GitHub Desktop.
Aphrodite Flow Types
// flow-typed signature: 20156f0acaa7b756a5b17b397b8b8220
// flow-typed version: <<STUB>>/aphrodite_v1.2.x/flow_v0.56.0
declare module "aphrodite" {
declare type SheetDefinition = {[id: string]: any};
declare opaque type SheetEntry;
// declare export type AphroditeExtension = {
// selectorHandler: SelectorHandler
// };
// A type-level function that describes stylesheet creation
declare type CreateStylesheet = <T: SheetDefinition>(T) => SheetEntry;
declare export class StyleSheet {
static create<T: {[name: string]: SheetDefinition}>(
sheet: T
): $ObjMap<T, CreateStylesheet>;
// TODO(zach): static extend()
}
declare type MaybeSheetEntry = SheetEntry | false | null | void;
declare export function css(...definitions: Array<MaybeSheetEntry>): string;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment