From ab581669701765bcf1420f644f2bff5caf7bb883 Mon Sep 17 00:00:00 2001 From: Rob Hogan Date: Mon, 26 Sep 2022 04:28:46 -0700 Subject: [PATCH] Consolidate `fb-watchman` Flow lib defs into Metro Summary: Add some internally-used Flow types to `fb-watchman`'s lib def for some cleanup. Reviewed By: huntie Differential Revision: D39742231 fbshipit-source-id: df5fb5e45be83b66df8bb1931c43ccbbf9e4fa5d --- flow-typed/fb-watchman.js | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/flow-typed/fb-watchman.js b/flow-typed/fb-watchman.js index fa6ea6647a..0883154362 100644 --- a/flow-typed/fb-watchman.js +++ b/flow-typed/fb-watchman.js @@ -15,14 +15,26 @@ declare module 'fb-watchman' { ... }>; - declare type WatchmanFile = $ReadOnly<{ - +exists: true, - +name: string, - +'content.sha1hex': string, + declare type SavedStateInfo = $ReadOnly<{ + 'manifold-path': ?string, + 'manifold-bucket': ?string, + error: ?string, }>; - declare type WatchmanQueryResponse = $ReadOnly<{ + declare export type WatchmanFile = $ReadOnly<{ + exists: true, + name: string, + 'content.sha1hex': string, + }>; + + declare export type WatchmanQueryResponse = $ReadOnly<{ + 'saved-state-info'?: SavedStateInfo, files: $ReadOnlyArray, + clock: { + scm: {'mergebase-with': string, mergebase: string}, + clock: string, + }, + is_fresh_instance: boolean, }>; declare type WatchmanExpression = Array< @@ -32,6 +44,11 @@ declare module 'fb-watchman' { declare type WatchmanQuerySince = { scm: { 'mergebase-with': string, + 'saved-state'?: { + storage: string, + config: {project: string, ...}, + ... + }, ... }, };