mirror of
https://github.com/darksaid98/new-phone-who-dis.git
synced 2026-12-04 22:16:40 +00:00
chore(typings): Moved common typings to root dir
This commit is contained in:
1 parent
378830245d
commit
f0c5e5101e
47 files changed
+41
-46
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
|
||||
import { Transfer } from '../../../common/typings/bank';
|
||||
import { Transfer } from '../../../../../typings/bank';
|
||||
import { bankState } from './state';
|
||||
|
||||
interface IBankNotification {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { bankState } from './state';
|
||||
import { IBankCredentials } from '../../../common/typings/bank';
|
||||
import { IBankCredentials } from '../../../../../typings/bank';
|
||||
|
||||
interface ICredentialsHook {
|
||||
credentials: IBankCredentials;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { contactsState } from './state';
|
||||
|
||||
import { Contact } from '../../../common/typings/contact';
|
||||
import { Contact } from '../../../../../typings/contact';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
interface IUseContacts {
|
||||
|
||||
@@ -8,7 +8,7 @@ import { ListItem } from '../../../../ui/components/ListItem';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
|
||||
import { useContacts } from '../../../contacts/hooks/useContacts';
|
||||
import { ICall } from '../../../../common/typings/call';
|
||||
import { ICall } from '../../../../../../typings/call';
|
||||
import dayjs from 'dayjs';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { Box, IconButton, ListItemIcon, ListItemText } from '@material-ui/core';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { ICall } from '../../../common/typings/call';
|
||||
import { ICall } from '../../../../../typings/call';
|
||||
import { dialState } from './state';
|
||||
interface ICallUI {
|
||||
history: ICall[];
|
||||
|
||||
@@ -6,7 +6,7 @@ import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { Autocomplete } from '@material-ui/lab';
|
||||
import { useContacts } from '../../../contacts/hooks/useContacts';
|
||||
import { Contact } from '../../../../common/typings/contact';
|
||||
import { Contact } from '../../../../../../typings/contact';
|
||||
|
||||
const NewMessageGroupForm = ({ phoneNumber }: { phoneNumber?: string }) => {
|
||||
const history = useHistory();
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
Badge,
|
||||
} from '@material-ui/core';
|
||||
|
||||
import { MessageGroup } from '../../../../common/typings/messages';
|
||||
import { MessageGroup } from '../../../../../../typings/messages';
|
||||
interface IProps {
|
||||
messageGroup: MessageGroup;
|
||||
handleClick: (group: MessageGroup) => () => void;
|
||||
@@ -22,7 +22,7 @@ const MessageGroupItem = ({ messageGroup, handleClick }: IProps): any => {
|
||||
return (
|
||||
<ListItem key={messageGroup.groupId} onClick={handleClick(messageGroup)} divider button>
|
||||
<ListItemAvatar>
|
||||
<Badge color='error' variant='dot' invisible={!hasUnread}>
|
||||
<Badge color="error" variant="dot" invisible={!hasUnread}>
|
||||
<MuiAvatar src={messageGroup?.avatar} />
|
||||
</Badge>
|
||||
</ListItemAvatar>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { Box, List } from '@material-ui/core';
|
||||
import { MessageGroup } from '../../../../common/typings/messages';
|
||||
import { MessageGroup } from '../../../../../../typings/messages';
|
||||
import Nui from '../../../../os/nui-events/utils/Nui';
|
||||
import useMessages from '../../hooks/useMessages';
|
||||
import MessageGroupItem from './MessageGroupItem';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React, { useState } from 'react';
|
||||
import { Box } from '@material-ui/core';
|
||||
|
||||
import { Message, MessageGroup } from '../../../../common/typings/messages';
|
||||
import { Message, MessageGroup } from '../../../../../../typings/messages';
|
||||
import MessageInput from '../form/MessageInput';
|
||||
import useStyles from './modal.styles';
|
||||
import { MessageImageModal } from './MessageImageModal';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Box, Link, makeStyles, Paper, Typography } from '@material-ui/core';
|
||||
import React from 'react';
|
||||
import { Message } from '../../../../common/typings/messages';
|
||||
import { Message } from '../../../../../../typings/messages';
|
||||
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
|
||||
import { PictureReveal } from '../../../../ui/components/PictureReveal';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useCallback } from 'react';
|
||||
import { useRecoilState, useRecoilValue } from 'recoil';
|
||||
import { CreateMessageGroupResult, Message, MessageGroup } from '../../../common/typings/messages';
|
||||
import { CreateMessageGroupResult, Message, MessageGroup } from '../../../../../typings/messages';
|
||||
import { messageState } from './state';
|
||||
|
||||
interface IUseMessages {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { Note } from '../../../common/typings/notes';
|
||||
import { Note } from '../../../../../typings/notes';
|
||||
import { noteStates } from './state';
|
||||
|
||||
interface NoteDetailProps {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { Note } from '../../../common/typings/notes';
|
||||
import { Note } from '../../../../../typings/notes';
|
||||
import { noteStates } from './state';
|
||||
|
||||
interface NotesProps {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Box, Tooltip, Button } from '@material-ui/core';
|
||||
import { makeStyles, Theme } from '@material-ui/core/styles';
|
||||
import React from 'react';
|
||||
import { MarketplaceListing } from '../../../../common/typings/marketplace';
|
||||
import { MarketplaceListing } from '../../../../../../typings/marketplace';
|
||||
import { useSimcard } from '../../../../os/simcard/hooks/useSimcard';
|
||||
import DeleteIcon from '@material-ui/icons/Delete';
|
||||
import ReportIcon from '@material-ui/icons/Report';
|
||||
|
||||
@@ -3,7 +3,7 @@ import { makeStyles } from '@material-ui/core/styles';
|
||||
import { Typography, Paper } from '@material-ui/core';
|
||||
import { ListItem } from '../../../../ui/components/ListItem';
|
||||
import { PictureResponsive } from '../../../../ui/components/PictureResponsive';
|
||||
import { MarketplaceListing } from '../../../../common/typings/marketplace';
|
||||
import { MarketplaceListing } from '../../../../../../typings/marketplace';
|
||||
import { ListingActions } from './ListingActions';
|
||||
import { PictureReveal } from '../../../../ui/components/PictureReveal';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { MarketplaceListing } from '../../../common/typings/marketplace';
|
||||
import { MarketplaceListing } from '../../../../../typings/marketplace';
|
||||
import { selloutState } from './state';
|
||||
|
||||
export const useListing = () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { atom, DefaultValue, SetterOrUpdater, useRecoilState } from 'recoil';
|
||||
|
||||
import { SETTINGS_ALL_TWEETS, SETTING_MENTIONS } from '../../../common/typings/twitter';
|
||||
import { SETTINGS_ALL_TWEETS, SETTING_MENTIONS } from '../../../../../typings/twitter';
|
||||
import config from '../../../config/default.json';
|
||||
import { SettingOption } from '../../../ui/hooks/useContextMenu';
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import ControlButtons from './buttons/ControlButtons';
|
||||
import IconButtons from './buttons/IconButtons';
|
||||
import { usePhone } from '../../../os/phone/hooks/usePhone';
|
||||
import { getNewLineCount } from '../utils/message';
|
||||
import { NewTweet } from '../../../common/typings/twitter';
|
||||
import { NewTweet } from '../../../../../typings/twitter';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
root: {
|
||||
|
||||
@@ -4,7 +4,7 @@ import { useTranslation } from 'react-i18next';
|
||||
import { makeStyles } from '@material-ui/core/styles';
|
||||
import { ListItemAvatar, Avatar as MuiAvatar, ListItem, Typography } from '@material-ui/core';
|
||||
|
||||
import { Tweet as ITweet } from '../../../../common/typings/twitter';
|
||||
import { Tweet as ITweet } from '../../../../../../typings/twitter';
|
||||
import { secondsToHumanReadable } from '../../utils/time';
|
||||
import LikeButton from '../buttons/LikeButton';
|
||||
import ReplyButton from '../buttons/ReplyButton';
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
export interface IAlertProps {
|
||||
message: string;
|
||||
type: 'success' | 'error';
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
export interface IBankCredentials {
|
||||
name: string;
|
||||
balance: number;
|
||||
}
|
||||
|
||||
export interface Transfer {
|
||||
id: number;
|
||||
targetID: number;
|
||||
source: string;
|
||||
type: string;
|
||||
transferAmount: number;
|
||||
message: string;
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
export interface CallProps {
|
||||
active: boolean;
|
||||
accepted: boolean;
|
||||
isTransmitter: boolean;
|
||||
transmitter: string;
|
||||
receiver: string;
|
||||
}
|
||||
|
||||
export interface ICall {
|
||||
id?: number;
|
||||
identifier: string;
|
||||
transmitter: string;
|
||||
transmitterSource?: number;
|
||||
receiver: string;
|
||||
receiverSource?: number;
|
||||
start: number;
|
||||
end?: number;
|
||||
accepted: boolean;
|
||||
}
|
||||
|
||||
export interface ICallDuration {
|
||||
ms: number;
|
||||
s: number;
|
||||
m: number;
|
||||
h: number;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
interface TwitterConfig {
|
||||
showNotifications: boolean;
|
||||
generateProfileNameFromUsers: boolean;
|
||||
allowEdtiableProfileName: boolean;
|
||||
allowDeleteTweets: boolean;
|
||||
allowReportTweets: boolean;
|
||||
characterLimit: number;
|
||||
newLineLimit: number;
|
||||
enableAvatars: boolean;
|
||||
enableEmojis: boolean;
|
||||
enableImages: boolean;
|
||||
maxImages: number;
|
||||
}
|
||||
|
||||
interface Debug {
|
||||
level: 'error' | 'warn' | 'info' | 'verbose' | 'debug';
|
||||
enabled: boolean;
|
||||
}
|
||||
|
||||
interface General {
|
||||
useDashNumber: boolean;
|
||||
}
|
||||
|
||||
interface NotificationConfig {
|
||||
horizontal: 'left' | 'center' | 'right';
|
||||
vertical: 'bottom' | 'top';
|
||||
}
|
||||
|
||||
interface BankConfig {
|
||||
showNotifications: boolean;
|
||||
}
|
||||
|
||||
export interface IServerConfig {
|
||||
Locale: string;
|
||||
KeyTogglePhone: number;
|
||||
KeyTakeCall: number;
|
||||
PhoneAsItem: boolean;
|
||||
SwimDestroy: boolean;
|
||||
RunRate: number;
|
||||
DestoryChance: number;
|
||||
DestroyPhoneReCheck: number;
|
||||
twitter: TwitterConfig;
|
||||
bank: BankConfig;
|
||||
notificationPosition: NotificationConfig;
|
||||
general: General;
|
||||
debug: Debug;
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
export type AlertCategory =
|
||||
| 'CONTACT_ADD_SUCCESS'
|
||||
| 'CONTACT_ADD_FAILED'
|
||||
| 'CONTACT_UPDATE_SUCCESS'
|
||||
| 'CONTACT_UPDATE_FAILED'
|
||||
| 'CONTACT_DELETE_SUCCESS'
|
||||
| 'CONTACT_DELETE_FAILED';
|
||||
|
||||
export interface IContactAlert {
|
||||
alert: AlertCategory;
|
||||
setAlert: (type: string) => void;
|
||||
}
|
||||
|
||||
export interface Contact {
|
||||
id: number;
|
||||
display: string;
|
||||
number: string;
|
||||
avatar?: string;
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
export interface MarketplaceListing {
|
||||
id: number;
|
||||
identifier?: string;
|
||||
username: string;
|
||||
name: string;
|
||||
number: string;
|
||||
title: string;
|
||||
url: string;
|
||||
description: string;
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
export interface Message {
|
||||
id: number;
|
||||
message: string;
|
||||
user_identifier: string;
|
||||
phone_number: string;
|
||||
groupId?: string;
|
||||
display?: string;
|
||||
avatar?: string;
|
||||
isRead: boolean;
|
||||
isMine: boolean;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface MessageGroup {
|
||||
groupId: string;
|
||||
groupDisplay: string;
|
||||
isGroupChat: boolean;
|
||||
avatar?: string;
|
||||
label?: string;
|
||||
updatedAt: string;
|
||||
unreadCount: number;
|
||||
phoneNumbers: string[];
|
||||
participants: string[];
|
||||
}
|
||||
|
||||
export interface CreateMessageGroupResult {
|
||||
error?: boolean;
|
||||
phoneNumber?: string;
|
||||
duplicate?: boolean;
|
||||
groupId?: string;
|
||||
mine?: boolean;
|
||||
identifiers?: string[];
|
||||
}
|
||||
|
||||
export interface CreateMessageBroadcast {
|
||||
message: string;
|
||||
groupName: string;
|
||||
groupId: string;
|
||||
}
|
||||
|
||||
export interface SetMessageRead {
|
||||
groupId: string;
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
export type AlertCategory =
|
||||
| 'NOTES_ADD_SUCCESS'
|
||||
| 'NOTES_ADD_FAILED'
|
||||
| 'NOTES_UPDATE_SUCCESS'
|
||||
| 'NOTES_UPDATE_FAILED'
|
||||
| 'NOTES_DELETE_SUCCESS'
|
||||
| 'NOTES_DELETE_FAILED';
|
||||
|
||||
export interface INotesAlert {
|
||||
alert: AlertCategory;
|
||||
setAlert: (type: AlertCategory) => void;
|
||||
}
|
||||
|
||||
export interface Note {
|
||||
id?: number;
|
||||
title: string;
|
||||
content: string;
|
||||
}
|
||||
|
||||
export interface NoteId {
|
||||
id: number;
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export interface IPhoto {
|
||||
image: string;
|
||||
id: number;
|
||||
}
|
||||
@@ -1,39 +0,0 @@
|
||||
export interface NewTweet {
|
||||
message: string;
|
||||
images?: string;
|
||||
retweet?: number;
|
||||
}
|
||||
|
||||
export type SETTING_MENTIONS = 'mentions';
|
||||
export type SETTINGS_ALL_TWEETS = 'all';
|
||||
|
||||
export interface Tweet extends NewTweet {
|
||||
profile_name: string;
|
||||
profile_id: number;
|
||||
id: number;
|
||||
isMine: boolean;
|
||||
isLiked: boolean;
|
||||
isReported: boolean;
|
||||
avatar_url: string;
|
||||
isRetweet: number | boolean;
|
||||
isRetweetedByPlayer?: boolean;
|
||||
retweetIdentifier: string;
|
||||
retweetId: string;
|
||||
seconds_since_tweet: number;
|
||||
retweetProfileName: string;
|
||||
retweetAvatarUrl: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface Profile {
|
||||
id: number;
|
||||
profile_name: string;
|
||||
identifier: string;
|
||||
avatar_url?: string;
|
||||
bio?: string;
|
||||
location?: string;
|
||||
job?: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useRecoilState } from 'recoil';
|
||||
import { CallProps } from '../../../common/typings/call';
|
||||
import { CallProps } from '../../../../../typings/call';
|
||||
import Nui from '../../nui-events/utils/Nui';
|
||||
import { callerState } from './state';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { CallProps } from '../../../common/typings/call';
|
||||
import { CallProps } from '../../../../../typings/call';
|
||||
import { useApp } from '../../apps/hooks/useApps';
|
||||
import { useNotifications } from '../../notifications/hooks/useNotifications';
|
||||
import { useRingtoneSound } from '../../sound/hooks/useRingtoneSound';
|
||||
@@ -65,7 +65,7 @@ export const useCallNotifications = () => {
|
||||
</CallNotification>
|
||||
),
|
||||
},
|
||||
(n) => addNotification(n)
|
||||
(n) => addNotification(n),
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@ import { useEffect, useState } from 'react';
|
||||
import { useNuiEvent } from '../../nui-events/hooks/useNuiEvent';
|
||||
import { useSetRecoilState } from 'recoil';
|
||||
import { useCall } from './useCall';
|
||||
import { CallProps } from '../../../common/typings/call';
|
||||
import { CallProps } from '../../../../../typings/call';
|
||||
import InjectDebugData from '../../debug/InjectDebugData';
|
||||
import { useCallModal } from './useCallModal';
|
||||
import { useHistory, useLocation } from 'react-router-dom';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { useRecoilValue } from 'recoil';
|
||||
import { IServerConfig } from '../../../common/typings/config';
|
||||
import { IServerConfig } from '../../../../../typings/config';
|
||||
import ServerConfig from '../../../config.autogen.json';
|
||||
import { useNotifications } from '../../notifications/hooks/useNotifications';
|
||||
import Nui from '../../nui-events/utils/Nui';
|
||||
|
||||
Reference in new issue
Block a user