TypeScript fixes
Summary: A pending change revamps a lot of how ESLint, Prettier, and Jest are configured in the repo, along with moving the world to TypeScript (and adding tsc usage). That still needs some work to split up, but this change adds types used in our unit tests that I found were missing. Differential Revision: D45506781 fbshipit-source-id: e3ee49ebef1b7d28c220ab08fd5740e31c8632cb
This commit is contained in:
committed by
Facebook GitHub Bot
parent
3156cb207f
commit
85f4eb43c9
16
javascript/src_js/wrapAsm.d.ts
vendored
16
javascript/src_js/wrapAsm.d.ts
vendored
@@ -65,12 +65,14 @@ export type Config = {
|
||||
* conformance fix previously disabled by "UseLegacyStretchBehaviour".
|
||||
*/
|
||||
setUseLegacyStretchBehaviour(useLegacyStretchBehaviour: boolean): void;
|
||||
getErrata(): Errata,
|
||||
setErrata(errata: Errata): void,
|
||||
getErrata(): Errata;
|
||||
setErrata(errata: Errata): void;
|
||||
useWebDefaults(): boolean;
|
||||
setUseWebDefaults(useWebDefaults: boolean): void;
|
||||
};
|
||||
|
||||
export type DirtiedFunction = (node: Node) => void;
|
||||
|
||||
export type MeasureFunction = (
|
||||
width: number,
|
||||
widthMode: MeasureMode,
|
||||
@@ -122,6 +124,7 @@ export type Node = {
|
||||
getWidth(): Value;
|
||||
insertChild(child: Node, index: number): void;
|
||||
isDirty(): boolean;
|
||||
isReferenceBaseline(): boolean;
|
||||
markDirty(): void;
|
||||
removeChild(child: Node): void;
|
||||
reset(): void;
|
||||
@@ -140,6 +143,7 @@ export type Node = {
|
||||
setFlexShrink(flexShrink: number): void;
|
||||
setFlexWrap(flexWrap: Wrap): void;
|
||||
setHeight(height: number | "auto" | `${number}%`): void;
|
||||
setIsReferenceBaseline(isReferenceBaseline: boolean): void;
|
||||
setHeightAuto(): void;
|
||||
setHeightPercent(height: number): void;
|
||||
setJustifyContent(justifyContent: Justify): void;
|
||||
@@ -151,6 +155,7 @@ export type Node = {
|
||||
setMaxHeightPercent(maxHeight: number): void;
|
||||
setMaxWidth(maxWidth: number | `${number}%`): void;
|
||||
setMaxWidthPercent(maxWidth: number): void;
|
||||
setDirtiedFunc(dirtiedFunc: DirtiedFunction | null): void;
|
||||
setMeasureFunc(measureFunc: MeasureFunction | null): void;
|
||||
setMinHeight(minHeight: number | `${number}%`): void;
|
||||
setMinHeightPercent(minHeight: number): void;
|
||||
@@ -165,19 +170,20 @@ export type Node = {
|
||||
setWidth(width: number | "auto" | `${number}%`): void;
|
||||
setWidthAuto(): void;
|
||||
setWidthPercent(width: number): void;
|
||||
unsetDirtiedFunc(): void;
|
||||
unsetMeasureFunc(): void;
|
||||
};
|
||||
|
||||
export type Yoga = {
|
||||
Config: {
|
||||
create(): Config;
|
||||
destroy(config: Config): any;
|
||||
destroy(config: Config): void;
|
||||
};
|
||||
Node: {
|
||||
create(): Node;
|
||||
create(config?: Config): Node;
|
||||
createDefault(): Node;
|
||||
createWithConfig(config: Config): Node;
|
||||
destroy(node: Node): any;
|
||||
destroy(node: Node): void;
|
||||
};
|
||||
} & typeof YGEnums;
|
||||
|
||||
|
Reference in New Issue
Block a user