about summary refs log tree commit diff
path: root/src/lib/labeling/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/labeling/types.ts')
-rw-r--r--src/lib/labeling/types.ts58
1 files changed, 58 insertions, 0 deletions
diff --git a/src/lib/labeling/types.ts b/src/lib/labeling/types.ts
new file mode 100644
index 000000000..d4efb499a
--- /dev/null
+++ b/src/lib/labeling/types.ts
@@ -0,0 +1,58 @@
+import {ComAtprotoLabelDefs} from '@atproto/api'
+import {LabelPreferencesModel} from 'state/models/ui/preferences'
+
+export type Label = ComAtprotoLabelDefs.Label
+
+export interface LabelValGroup {
+  id: keyof LabelPreferencesModel | 'illegal' | 'unknown'
+  title: string
+  imagesOnly: boolean
+  subtitle?: string
+  warning: string
+  values: string[]
+}
+
+export interface PostLabelInfo {
+  postLabels: Label[]
+  accountLabels: Label[]
+  profileLabels: Label[]
+  isMuted: boolean
+}
+
+export interface ProfileLabelInfo {
+  accountLabels: Label[]
+  profileLabels: Label[]
+  isMuted: boolean
+}
+
+export enum ModerationBehaviorCode {
+  Show,
+  Hide,
+  Warn,
+  WarnContent,
+  WarnImages,
+}
+
+export interface ModerationBehavior {
+  behavior: ModerationBehaviorCode
+  noOverride?: boolean
+  reason?: string
+}
+
+export interface AvatarModeration {
+  warn: boolean
+  blur: boolean
+}
+
+export interface PostModeration {
+  avatar: AvatarModeration
+  list: ModerationBehavior
+  thread: ModerationBehavior
+  view: ModerationBehavior
+}
+
+export interface ProfileModeration {
+  avatar: AvatarModeration
+  list: ModerationBehavior
+  view: ModerationBehavior
+}