parts.svelte.ts

Declarations
#

4 declarations

view source

Parts
#

parts.svelte.ts view source

inheritance

extends:
  • Cell<typeof PartsJson>

items

type IndexedCollection<PartUnion>

readonly

constructor

type new (options: PartsOptions): Parts

options

add

Add a part to the collection.

type (json: { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; }): PartUnion

json
type { id?: string | undefined; created?: string | undefined; updated?: string | undefined; name?: string | undefined; start?: number | null | undefined; end?: number | null | undefined; ... 7 more ...; content?: string | undefined; } | { ...; }
returns PartUnion

generate_unique_name

Generate a unique name for a part.

type (base_name?: string): string

base_name
type string
default 'new part'
returns string

remove

Remove a part by id.

type (id: string & $brand<"Uuid">): boolean

id
type string & $brand<"Uuid">
returns boolean

find_part_by_diskfile_path

Find a part that references a specific file path.

type (path: string): PartUnion | undefined

path
type string
returns PartUnion | undefined

PartsJson
#

parts.svelte.ts view source

ZodObject<{ id: ZodDefault<$ZodBranded<ZodUUID, "Uuid", "out">>; created: ZodDefault<$ZodBranded<ZodISODateTime, "Datetime", "out">>; updated: ZodDefault<...>; items: ZodDefault<...>; }, $strict>

PartsJsonInput
#

parts.svelte.ts view source

{ id?: string | undefined; created?: string | undefined; updated?: string | undefined; items?: ({ id?: string | undefined; created?: string | undefined; updated?: string | undefined; ... 10 more ...; content?: string | undefined; } | { ...; })[] | undefined; }

PartsOptions
#

Depends on
#

Imported by
#