expo-rollup module. Expo and React Native explains how to install it. Each function wraps a call of the Swift SDK, and each value has the fields of its Swift type, in the shapes below. The package ships these TypeScript types.
Setup
configure
missingRequirement when the app lacks something the SDK needs, and with simulatorUnsupported in the iOS Simulator.
requestPhotoAccess
startIndexing
getIndexOptions
reset
Indexing state
useIndexingState
null until the first state arrives, and always null where Rollup is not available.
getIndexingState
addIndexingStateListener
listener with the current state and every change after it, until you call remove().
isSearchable
ready, or indexing with searchable true.
Search, query and profile
search
query
profile
null where their life does not say, with the photos behind each filled field. Pass the schema as an object. Same permission as query. See Profile.
Availability
isAvailable is true on iOS with the native module linked. Elsewhere it is false, sdkVersion is null, and every call rejects with unsupportedPlatform.
Helpers
indexWindow.growing reaches back from and keeps adding new photos; nothing ages out. indexWindow.sliding keeps only the most recent span, and removes older photos as time passes.
Types
Enums are objects tagged bytype. Dates are ISO 8601 strings.
IndexingState
searchable means search, query and profile already work on the photos indexed so far.
PhotoAccess
IndexOptionsInput and IndexOptions
configure takes the fields to change; every field you leave out keeps the SDK’s default. getIndexOptions returns every field. See Index options for what each one does.
SearchResults
Answer
Profile
json is a parsed object, not a string. Pass your own type to profile<T>() to type it. Keys of evidence are JSON Pointers, such as /food/favorite_cuisine.
JSONValue
Errors
Every call rejects with aRollupError:
message is for developers, not for the person. A failed indexing state carries the same fields as a plain object (RollupErrorBody).