mirror of
https://github.com/utopia-os/utopia-ui.git
synced 2025-12-13 07:46:10 +00:00
reorganized types
This commit is contained in:
parent
a450128b72
commit
ddb0d481fb
4
types/AssetsApi.d.ts
vendored
4
types/AssetsApi.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
export interface AssetsApi {
|
||||
upload(file: Blob, title: string): Promise<{ id: string }>
|
||||
url: string
|
||||
}
|
||||
20
types/FormState.d.ts
vendored
20
types/FormState.d.ts
vendored
@ -1,20 +0,0 @@
|
||||
import type { Item } from './Item'
|
||||
import type { Tag } from './Tag'
|
||||
|
||||
export interface FormState {
|
||||
color: string
|
||||
id: string
|
||||
group_type: string
|
||||
status: string
|
||||
name: string
|
||||
subname: string
|
||||
text: string
|
||||
contact: string
|
||||
telephone: string
|
||||
next_appointment: string
|
||||
image: string
|
||||
marker_icon: string
|
||||
offers: Tag[]
|
||||
needs: Tag[]
|
||||
relations: Item[]
|
||||
}
|
||||
44
types/Item.d.ts
vendored
44
types/Item.d.ts
vendored
@ -1,44 +0,0 @@
|
||||
import type { ItemsApi } from './ItemsApi'
|
||||
import type { LayerProps } from './LayerProps'
|
||||
import type { Relation } from './Relation'
|
||||
import type { UserItem } from './UserItem'
|
||||
import type { Point } from 'geojson'
|
||||
|
||||
export interface Item {
|
||||
id: string
|
||||
name: string
|
||||
text: string
|
||||
position?: Point
|
||||
date_created?: string
|
||||
date_updated?: string | null
|
||||
start?: string
|
||||
end?: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
api?: ItemsApi<any>
|
||||
tags?: string[]
|
||||
layer?: LayerProps
|
||||
relations?: Relation[]
|
||||
parent?: string
|
||||
subname?: string
|
||||
public_edit?: boolean
|
||||
slug?: string
|
||||
user_created?: UserItem
|
||||
image?: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any
|
||||
/* constructor(
|
||||
id: string,
|
||||
name: string,
|
||||
text: string,
|
||||
position: Geometry,
|
||||
layer?: LayerProps,
|
||||
api?: ItemsApi<any>,
|
||||
) {
|
||||
this.id = id
|
||||
this.name = name
|
||||
this.text = text
|
||||
this.position = position
|
||||
this.layer = layer
|
||||
this.api = api
|
||||
} */
|
||||
}
|
||||
11
types/ItemFormPopupProps.d.ts
vendored
11
types/ItemFormPopupProps.d.ts
vendored
@ -1,11 +0,0 @@
|
||||
import type { Item } from './Item'
|
||||
import type { LayerProps } from './LayerProps'
|
||||
import type { LatLng } from 'leaflet'
|
||||
|
||||
export interface ItemFormPopupProps {
|
||||
position: LatLng
|
||||
layer: LayerProps
|
||||
item?: Item
|
||||
children?: React.ReactNode
|
||||
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>
|
||||
}
|
||||
5
types/ItemType.d.ts
vendored
5
types/ItemType.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export interface ItemType {
|
||||
name: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any
|
||||
}
|
||||
8
types/ItemsApi.d.ts
vendored
8
types/ItemsApi.d.ts
vendored
@ -1,8 +0,0 @@
|
||||
export interface ItemsApi<T> {
|
||||
getItems(): Promise<T[]>
|
||||
getItem?(id: string): Promise<T>
|
||||
createItem?(item: T): Promise<T>
|
||||
updateItem?(item: T): Promise<T>
|
||||
deleteItem?(id: string): Promise<boolean>
|
||||
collectionName?: string
|
||||
}
|
||||
42
types/LayerProps.d.ts
vendored
42
types/LayerProps.d.ts
vendored
@ -1,42 +0,0 @@
|
||||
import type { Item } from './Item'
|
||||
import type { ItemFormPopupProps } from './ItemFormPopupProps'
|
||||
import type { ItemsApi } from './ItemsApi'
|
||||
import type { ItemType } from './ItemType'
|
||||
|
||||
export interface LayerProps {
|
||||
id?: string
|
||||
data?: Item[]
|
||||
children?: React.ReactNode
|
||||
name: string
|
||||
menuIcon: string
|
||||
menuColor: string
|
||||
menuText: string
|
||||
markerIcon: string
|
||||
markerShape: string
|
||||
markerDefaultColor: string
|
||||
markerDefaultColor2?: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
api?: ItemsApi<any>
|
||||
itemType: ItemType
|
||||
itemNameField?: string
|
||||
itemSubnameField?: string
|
||||
itemTextField?: string
|
||||
itemAvatarField?: string
|
||||
itemColorField?: string
|
||||
itemOwnerField?: string
|
||||
itemTagsField?: string
|
||||
itemLatitudeField?: string
|
||||
itemLongitudeField?: string
|
||||
itemOffersField?: string
|
||||
itemNeedsField?: string
|
||||
onlyOnePerOwner?: boolean
|
||||
customEditLink?: string
|
||||
customEditParameter?: string
|
||||
public_edit_items?: boolean
|
||||
listed?: boolean
|
||||
item_presets?: Record<string, unknown>
|
||||
setItemFormPopup?: React.Dispatch<React.SetStateAction<ItemFormPopupProps | null>>
|
||||
itemFormPopup?: ItemFormPopupProps | null
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
clusterRef?: any
|
||||
}
|
||||
13
types/Permission.d.ts
vendored
13
types/Permission.d.ts
vendored
@ -1,13 +0,0 @@
|
||||
import type { PermissionAction } from './PermissionAction'
|
||||
import type { PermissionCondition } from './PermissionCondition'
|
||||
|
||||
export interface Permission {
|
||||
id?: string
|
||||
policy?: { name: string }
|
||||
collection: string
|
||||
action: PermissionAction
|
||||
permissions?: {
|
||||
// Optional, für spezifische Bedingungen wie `user_created`
|
||||
_and: PermissionCondition[]
|
||||
}
|
||||
}
|
||||
1
types/PermissionAction.d.ts
vendored
1
types/PermissionAction.d.ts
vendored
@ -1 +0,0 @@
|
||||
export type PermissionAction = 'create' | 'read' | 'update' | 'delete'
|
||||
8
types/PermissionCondition.d.ts
vendored
8
types/PermissionCondition.d.ts
vendored
@ -1,8 +0,0 @@
|
||||
export interface PermissionCondition {
|
||||
user_created?: {
|
||||
_eq: string // Erwartet den speziellen Wert "$CURRENT_USER" oder eine spezifische UUID
|
||||
}
|
||||
public_edit?: {
|
||||
_eq: boolean // Erwartet den speziellen Wert "$CURRENT_USER" oder eine spezifische UUID
|
||||
}
|
||||
}
|
||||
10
types/Profile.d.ts
vendored
10
types/Profile.d.ts
vendored
@ -1,10 +0,0 @@
|
||||
import type { Geometry } from 'geojson'
|
||||
|
||||
export interface Profile {
|
||||
id?: string
|
||||
avatar?: string
|
||||
color?: string
|
||||
name: string
|
||||
text: string
|
||||
geoposition?: Geometry
|
||||
}
|
||||
5
types/Relation.d.ts
vendored
5
types/Relation.d.ts
vendored
@ -1,5 +0,0 @@
|
||||
export interface Relation {
|
||||
related_items_id: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any
|
||||
}
|
||||
6
types/Tag.d.ts
vendored
6
types/Tag.d.ts
vendored
@ -1,6 +0,0 @@
|
||||
export interface Tag {
|
||||
color: string
|
||||
id: string
|
||||
name: string
|
||||
offer_or_need?: boolean
|
||||
}
|
||||
12
types/UserApi.d.ts
vendored
12
types/UserApi.d.ts
vendored
@ -1,12 +0,0 @@
|
||||
import type { UserItem } from './UserItem'
|
||||
|
||||
export interface UserApi {
|
||||
register(email: string, password: string, userName: string): Promise<void>
|
||||
login(email: string, password: string): Promise<UserItem | undefined>
|
||||
logout(): Promise<void>
|
||||
getUser(): Promise<UserItem>
|
||||
getToken(): Promise<string | null>
|
||||
updateUser(user: UserItem): Promise<void>
|
||||
requestPasswordReset(email: string, reset_url?: string)
|
||||
passwordReset(token: string, new_password: string)
|
||||
}
|
||||
13
types/UserItem.d.ts
vendored
13
types/UserItem.d.ts
vendored
@ -1,13 +0,0 @@
|
||||
import type { Profile } from './Profile'
|
||||
|
||||
export interface UserItem {
|
||||
id?: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
role?: any
|
||||
email?: string
|
||||
password?: string
|
||||
profile?: Profile
|
||||
first_name?: string
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
[key: string]: any
|
||||
}
|
||||
16
types/UtopiaMapProps.d.ts
vendored
16
types/UtopiaMapProps.d.ts
vendored
@ -1,16 +0,0 @@
|
||||
import type { Tag } from './Tag'
|
||||
import type { GeoJsonObject } from 'geojson'
|
||||
|
||||
export interface UtopiaMapProps {
|
||||
height?: string
|
||||
width?: string
|
||||
center?: [number, number]
|
||||
zoom?: number
|
||||
tags?: Tag[]
|
||||
children?: React.ReactNode
|
||||
geo?: GeoJsonObject
|
||||
showFilterControl?: boolean
|
||||
showLayerControl?: boolean
|
||||
showGratitudeControl?: boolean
|
||||
infoText?: string
|
||||
}
|
||||
16
types/index.d.ts
vendored
16
types/index.d.ts
vendored
@ -1,16 +0,0 @@
|
||||
export * from './AssetsApi'
|
||||
export * from './FormState'
|
||||
export * from './Item'
|
||||
export * from './ItemFormPopupProps'
|
||||
export * from './ItemsApi'
|
||||
export * from './ItemType'
|
||||
export * from './LayerProps'
|
||||
export * from './Permission'
|
||||
export * from './PermissionAction'
|
||||
export * from './PermissionCondition'
|
||||
export * from './Profile'
|
||||
export * from './Relation'
|
||||
export * from './Tag'
|
||||
export * from './UserApi'
|
||||
export * from './UserItem'
|
||||
export * from './UtopiaMapProps'
|
||||
Loading…
x
Reference in New Issue
Block a user