mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-21 19:40:34 +00:00
feat(native): share a booking document to TREK and import it into a trip
TREK now appears under "Open in" and in the share sheet for PDFs, calendar entries, Wallet passes and mails (iOS document types, Android VIEW and SEND filters). The native side reads the file (up to 15 MB) and hands it to the UI, which asks which trip it belongs to, upcoming trips first, then opens that trip's booking import with the file already chosen.
This commit is contained in:
@@ -49,6 +49,20 @@ export interface TrekShellPlugin {
|
||||
event: 'location',
|
||||
listener: (payload: NativeLocationPayload) => void
|
||||
): Promise<{ remove: () => Promise<void> }>;
|
||||
addListener(
|
||||
event: 'sharedFile',
|
||||
listener: (payload: SharedFilePayload) => void
|
||||
): Promise<{ remove: () => Promise<void> }>;
|
||||
/** Feature sharedFiles: the booking document shared to TREK before the UI ran. */
|
||||
takeSharedFile(): Promise<{ file: SharedFilePayload | null }>;
|
||||
}
|
||||
|
||||
/** A document shared to TREK, as the native side reads it. */
|
||||
export interface SharedFilePayload {
|
||||
name: string;
|
||||
mimeType: string;
|
||||
/** base64 */
|
||||
data: string;
|
||||
}
|
||||
|
||||
/** A position, or an error shaped like GeolocationPositionError (1 denied, 2 unavailable). */
|
||||
|
||||
Reference in New Issue
Block a user