2024-10-05 19:33:09 +02:00
|
|
|
/*
|
|
|
|
|
* Copyright (C) Contributors to the Suwayomi project
|
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
2026-03-11 00:11:29 +01:00
|
|
|
import type { MessageDescriptor } from '@lingui/core';
|
|
|
|
|
import type { ReactNode } from 'react';
|
2024-10-03 04:03:04 +02:00
|
|
|
|
2024-10-05 19:33:09 +02:00
|
|
|
export enum GridLayout {
|
|
|
|
|
Compact = 0,
|
|
|
|
|
Comfortable = 1,
|
|
|
|
|
List = 2,
|
|
|
|
|
}
|
2024-10-03 04:03:04 +02:00
|
|
|
|
2025-08-16 02:48:46 +02:00
|
|
|
export enum DirectionOffset {
|
|
|
|
|
PREVIOUS = -1,
|
|
|
|
|
NEXT = 1,
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-10 19:45:02 +01:00
|
|
|
interface DisplayDataTranslation {
|
2024-10-28 18:03:29 +01:00
|
|
|
isTitleString?: never;
|
2026-01-10 19:45:02 +01:00
|
|
|
title: MessageDescriptor;
|
2024-10-28 18:03:29 +01:00
|
|
|
icon: ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface DisplayDataString {
|
|
|
|
|
isTitleString: true;
|
|
|
|
|
title: string;
|
|
|
|
|
icon: ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-10 19:45:02 +01:00
|
|
|
type DisplayData = DisplayDataTranslation | DisplayDataString;
|
2024-10-28 18:03:29 +01:00
|
|
|
|
|
|
|
|
export type ValueToDisplayData<Value extends string | number> = Record<Value, DisplayData>;
|
2024-11-04 18:00:35 +01:00
|
|
|
|
|
|
|
|
export interface MultiValueButtonBaseProps<Value extends string | number> {
|
2024-12-09 16:24:32 +01:00
|
|
|
tooltip?: string;
|
2024-11-04 18:00:35 +01:00
|
|
|
value: Value;
|
2024-12-13 01:52:28 +01:00
|
|
|
defaultValue?: Value;
|
2024-11-04 18:00:35 +01:00
|
|
|
values: Value[];
|
|
|
|
|
setValue: (value: Value) => void;
|
|
|
|
|
valueToDisplayData: ValueToDisplayData<Value>;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-08 23:25:02 +01:00
|
|
|
export interface MultiValueButtonDefaultableProps<Value extends string | number> extends OptionalProperty<
|
|
|
|
|
MultiValueButtonBaseProps<Value>,
|
|
|
|
|
'value'
|
|
|
|
|
> {
|
2024-11-04 18:00:35 +01:00
|
|
|
isDefaultable?: boolean;
|
|
|
|
|
onDefault?: () => void;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type MultiValueButtonProps<Value extends string | number> =
|
|
|
|
|
| (MultiValueButtonBaseProps<Value> & PropertiesNever<MultiValueButtonDefaultableProps<Value>>)
|
|
|
|
|
| MultiValueButtonDefaultableProps<Value>;
|
2024-11-03 03:09:00 +01:00
|
|
|
|
|
|
|
|
export enum ScrollOffset {
|
|
|
|
|
BACKWARD,
|
|
|
|
|
FORWARD,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export enum ScrollDirection {
|
|
|
|
|
X,
|
|
|
|
|
Y,
|
2024-12-06 00:16:07 +01:00
|
|
|
XY,
|
2024-11-03 03:09:00 +01:00
|
|
|
}
|
2025-07-23 01:52:41 +02:00
|
|
|
|
|
|
|
|
export enum SearchParam {
|
|
|
|
|
TAB = 'tab',
|
|
|
|
|
QUERY = 'query',
|
2025-07-27 00:03:51 +02:00
|
|
|
REDIRECT = 'redirect',
|
2025-07-23 01:52:41 +02:00
|
|
|
}
|