UNPKG

2.1 kBTypeScriptView Raw
1import { NavigationContainerRef, ParamListBase } from '@react-navigation/core';
2import * as React from 'react';
3import type { LinkingOptions } from './types';
4declare type Options = LinkingOptions<ParamListBase> & {
5 independent?: boolean;
6};
7export default function useLinking(ref: React.RefObject<NavigationContainerRef<ParamListBase>>, { independent, enabled, config, getStateFromPath, getPathFromState, getActionFromState, }: Options): {
8 getInitialState: () => PromiseLike<(Partial<Omit<Readonly<{
9 key: string;
10 index: number;
11 routeNames: string[];
12 history?: unknown[] | undefined;
13 routes: (Readonly<{
14 key: string;
15 name: string;
16 path?: string | undefined;
17 }> & Readonly<{
18 params?: Readonly<object | undefined>;
19 }> & {
20 state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
21 })[];
22 type: string;
23 stale: false;
24 }>, "stale" | "routes">> & Readonly<{
25 stale?: true | undefined;
26 routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
27 }> & {
28 state?: (Partial<Omit<Readonly<{
29 key: string;
30 index: number;
31 routeNames: string[];
32 history?: unknown[] | undefined;
33 routes: (Readonly<{
34 key: string;
35 name: string;
36 path?: string | undefined;
37 }> & Readonly<{
38 params?: Readonly<object | undefined>;
39 }> & {
40 state?: Readonly<any> | import("@react-navigation/core").PartialState<Readonly<any>> | undefined;
41 })[];
42 type: string;
43 stale: false;
44 }>, "stale" | "routes">> & Readonly<{
45 stale?: true | undefined;
46 routes: import("@react-navigation/core").PartialRoute<import("@react-navigation/core").Route<string, object | undefined>>[];
47 }> & any) | undefined;
48 }) | undefined>;
49};
50export {};