mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-23 20:01:01 +08:00
packager: HasteMap: @flow + fixes
Summary: Add Flow types, revealing a few problems, such as `isHaste` having the wrong return value in the "pseudo-mocks". But since the buck worker is in fact working, I guess these functions were never called... The point of typing this file is that I'm going to start aggressively pruning dead code in `node-haste` and hopefully, eventually, get rid of `Moduleish` and `Packageish`. Reviewed By: davidaurelio Differential Revision: D5052379 fbshipit-source-id: dab3f18f05fcf43fbbc48b589170b1cf367d6a48
This commit is contained in:
committed by
Facebook Github Bot
parent
ffe18867f2
commit
4ae8e5e21a
@@ -49,21 +49,26 @@ export type ModuleMap = {
|
||||
): ?string,
|
||||
};
|
||||
|
||||
type Packageish = {
|
||||
export type Packageish = {
|
||||
isHaste(): boolean,
|
||||
getName(): Promise<string>,
|
||||
path: string,
|
||||
redirectRequire(toModuleName: string): string | false,
|
||||
getMain(): string,
|
||||
+root: string,
|
||||
};
|
||||
|
||||
type Moduleish = {
|
||||
export type Moduleish = {
|
||||
+path: string,
|
||||
isHaste(): boolean,
|
||||
getName(): Promise<string>,
|
||||
getPackage(): ?Packageish,
|
||||
hash(): string,
|
||||
readCached(transformOptions: TransformWorkerOptions): CachedReadResult,
|
||||
readFresh(transformOptions: TransformWorkerOptions): Promise<ReadResult>,
|
||||
};
|
||||
|
||||
type ModuleishCache<TModule, TPackage> = {
|
||||
export type ModuleishCache<TModule, TPackage> = {
|
||||
getPackage(
|
||||
name: string,
|
||||
platform?: string,
|
||||
|
||||
Reference in New Issue
Block a user