mattermost-mobile/types/global/utilities.d.ts
Elias Nahum edef4ec4a3
Update libraries and dependencies (#7678)
* update js dependencies

* update react-native libraries

* update watermelonDB

* update RN to 0.72.7

* update fastlane

* fix remove_markdown/at_mention import

* update mattermost libraries

* update fastlane deps

* remove haptic-feedback patch

* update okhttp to 4.12.0 and patch netinfo to accurately identify VPN connections

* create ImaegStyles intersection type
2023-11-25 07:46:13 +08:00

33 lines
1.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
type $ID<E extends {id: string}> = E['id'];
type $UserID<E extends {user_id: string}> = E['user_id'];
type $Name<E extends {name: string}> = E['name'];
type $Username<E extends {username: string}> = E['username'];
type $Email<E extends {email: string}> = E['email'];
type RelationOneToOne<E extends {id: string}, T> = {
[x in $ID<E>]: T;
};
type RelationOneToMany<E1 extends {id: string}, E2 extends {id: string}> = {
[x in $ID<E1>]: Array<$ID<E2>>;
};
type IDMappedObjects<E extends {id: string}> = RelationOneToOne<E, E>;
type UserIDMappedObjects<E extends {user_id: string}> = {
[x in $UserID<E>]: E;
};
type NameMappedObjects<E extends {name: string}> = {
[x in $Name<E>]: E;
};
type UsernameMappedObjects<E extends {username: string}> = {
[x in $Username<E>]: E;
};
type EmailMappedObjects<E extends {email: string}> = {
[x in $Email<E>]: E;
};
type Dictionary<T> = {
[key: string]: T;
};
type Intersection<T1, T2> = Omit<Omit<T1&T2, keyof(Omit<T1, keyof(T2)>)>, keyof(Omit<T2, keyof(T1)>)>;