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