-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtypes.d.ts
84 lines (72 loc) · 2.34 KB
/
types.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/**
* Learn more about using TypeScript with React Navigation:
* https://reactnavigation.org/docs/typescript/
*/
import { BottomTabScreenProps } from "@react-navigation/bottom-tabs";
import {
CompositeScreenProps,
NavigatorScreenParams,
} from "@react-navigation/native";
import { NativeStackScreenProps } from "@react-navigation/native-stack";
import type {SettingsState} from "@/hydrate/settings";
declare global {
namespace ReactNavigation {
interface RootParamList extends RootStackParamList{}
}
}
export type RootStackParamList = {
Root: NavigatorScreenParams<RootTabParamList> | undefined;
Modal: undefined;
NotFound: undefined;
Player: {track} | undefined;
Playlist: { id?: number; likedSongs?: unknown };
Album: {id?: number; likedSongs?: unknown };
Artist: {id?: number; likedSongs?: unknown };
}
export type RootStackScreenProps<Screen extends keyof RootStackParamList> =
NativeStackScreenProps<RootStackParamList, Screen>;
export type RootTabParamList = {
Home: undefined;
Explore: undefined;
Library: undefined;
Settings: undefined;
};
export type RootTabScreenProps<Screen extends keyof RootTabParamList> =
CompositeScreenProps<
BottomTabScreenProps<RootTabParamList, Screen>,
NativeStackScreenProps<RootStackParamList>
>;
type test = NativeStackScreenProps<RootTabParamList | SettingsStackParamList | LibraryStackParamList>["navigation"]["navigate"]
export type SettingsStackParamList = {
MainSettings: undefined;
SubSettings: { requestSubSettings: keyof SettingsState } | undefined;
Library: undefined
};
export type SettingsStackScreenProps<Screen extends keyof SettingsStackParamList> = NativeStackScreenProps<SettingsStackParamList, Screen>
export type LibraryStackParamList = {
Library: undefined;
Login: undefined;
}
export type LibraryStackScreenProps<Screen extends keyof LibraryStackParamList> = NativeStackScreenProps<LibraryStackParamList, Screen>
// options used in settings screens
export interface OptionType<T extends keyof SettingsState = any> {
option: SettingsState[T];
name: string;
}
export interface PlaylistProps {
id: Number;
coverImgUrl: String;
name: String;
privacy: Number;
}
export interface PlaylistDetailProp {
updateTime: Date;
trackCount: Number;
creator: {
nickname: string;
};
description: string;
}
export interface ResponseFormat {
code: number;
}