Notification: Limit lang types (#5448)
This commit is contained in:
parent
9389014372
commit
d4864f93d3
@ -2,7 +2,7 @@ import type { TeactNode } from '../../lib/teact/teact';
|
||||
|
||||
import type { CallbackAction } from '../../global/types';
|
||||
import type { IconName } from '../../types/icons';
|
||||
import type { LangFnParameters } from '../../util/localization';
|
||||
import type { RegularLangFnParameters } from '../../util/localization';
|
||||
import type { ApiDocument, ApiPhoto, ApiReaction } from './messages';
|
||||
import type { ApiPremiumSection, ApiStarsSubscriptionPricing } from './payments';
|
||||
import type { ApiUser } from './users';
|
||||
@ -116,10 +116,10 @@ export type ApiNotifyException = {
|
||||
export type ApiNotification = {
|
||||
localId: string;
|
||||
containerSelector?: string;
|
||||
title?: string | LangFnParameters;
|
||||
message: TeactNode | LangFnParameters;
|
||||
title?: string | RegularLangFnParameters;
|
||||
message: TeactNode | RegularLangFnParameters;
|
||||
cacheBreaker?: string;
|
||||
actionText?: string | LangFnParameters;
|
||||
actionText?: string | RegularLangFnParameters;
|
||||
action?: CallbackAction | CallbackAction[];
|
||||
className?: string;
|
||||
duration?: number;
|
||||
|
||||
@ -10,6 +10,7 @@ import type { LangKey, LangVariable } from '../../types/language';
|
||||
import {
|
||||
type AdvancedLangFnOptions,
|
||||
type AdvancedLangFnOptionsWithPlural,
|
||||
type AdvancedLangFnParameters,
|
||||
areAdvancedLangFnOptions,
|
||||
isDeletedLangString,
|
||||
isPluralLangString,
|
||||
@ -18,6 +19,7 @@ import {
|
||||
type LangFnOptionsWithPlural,
|
||||
type LangFnParameters,
|
||||
type LangFormatters,
|
||||
type RegularLangFnParameters,
|
||||
} from './types';
|
||||
|
||||
import { DEBUG, LANG_PACK } from '../../config';
|
||||
@ -440,4 +442,6 @@ export {
|
||||
export type {
|
||||
LangFn,
|
||||
LangFnParameters,
|
||||
RegularLangFnParameters,
|
||||
AdvancedLangFnParameters,
|
||||
};
|
||||
|
||||
@ -73,7 +73,7 @@ type RegularLangFnPluralParametersWithVariables<T = LangPairPluralWithVariables>
|
||||
}
|
||||
}[keyof T];
|
||||
|
||||
type RegularLangFnParameters =
|
||||
export type RegularLangFnParameters =
|
||||
| RegularLangFnParametersWithoutVariables
|
||||
| RegularLangFnParametersWithVariables
|
||||
| RegularLangFnPluralParameters
|
||||
@ -107,7 +107,7 @@ type AdvancedLangFnPluralParametersWithVariables<T = LangPairPluralWithNodes> =
|
||||
}
|
||||
}[keyof T];
|
||||
|
||||
type AdvancedLangFnParameters =
|
||||
export type AdvancedLangFnParameters =
|
||||
| AdvancedLangFnParametersWithoutVariables
|
||||
| AdvancedLangFnParametersWithVariables
|
||||
| AdvancedLangFnPluralParameters
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user