@esposter/shared
Advanced tools
+390
-76
| import { z } from "zod"; | ||
| import { HTMLElement } from "node-html-parser"; | ||
| //#region src/test/constants.d.ts | ||
| declare const AllSpecialValues: { | ||
| isPlainObject: boolean; | ||
| value: unknown; | ||
| }[]; | ||
| //#endregion | ||
| //#region src/models/shared/Operation.d.ts | ||
@@ -11,3 +16,3 @@ declare enum Operation { | ||
| Unshift = "Unshift", | ||
| Update = "Update", | ||
| Update = "Update" | ||
| } | ||
@@ -21,9 +26,9 @@ //#endregion | ||
| //#region src/models/error/NotFoundError.d.ts | ||
| declare class NotFoundError<T$1 extends string = string> extends Error { | ||
| constructor(name: T$1, id: string); | ||
| declare class NotFoundError<T extends string = string> extends Error { | ||
| constructor(name: T, id: string); | ||
| } | ||
| //#endregion | ||
| //#region src/models/error/NotInitializedError.d.ts | ||
| declare class NotInitializedError<T$1 extends string = string> extends Error { | ||
| constructor(name: T$1); | ||
| declare class NotInitializedError<T extends string = string> extends Error { | ||
| constructor(name: T); | ||
| } | ||
@@ -44,2 +49,3 @@ //#endregion | ||
| readonly FlowchartEditor: "/flowchart-editor"; | ||
| readonly FluidSimulator: "/fluid-simulator"; | ||
| readonly Github: "https://github.com/Esposter/Esposter"; | ||
@@ -64,3 +70,3 @@ readonly Index: "/"; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/primitive.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/primitive.d.ts | ||
| /** | ||
@@ -73,3 +79,3 @@ Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/basic.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/basic.d.ts | ||
| /** | ||
@@ -80,8 +86,8 @@ Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). | ||
| */ | ||
| type Class<T$1, Arguments extends unknown[] = any[]> = { | ||
| prototype: Pick<T$1, keyof T$1>; | ||
| new (...arguments_: Arguments): T$1; | ||
| type Class<T, Arguments extends unknown[] = any[]> = { | ||
| prototype: Pick<T, keyof T>; | ||
| new (...arguments_: Arguments): T; | ||
| }; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-any.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-any.d.ts | ||
| /** | ||
@@ -115,5 +121,5 @@ Returns a boolean for whether the given type is `any`. | ||
| */ | ||
| type IsAny<T$1> = 0 extends 1 & NoInfer<T$1> ? true : false; | ||
| type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-optional-key-of.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-optional-key-of.d.ts | ||
| /** | ||
@@ -159,5 +165,5 @@ Returns a boolean for whether the given key is an optional key of type. | ||
| */ | ||
| type IsOptionalKeyOf<Type extends object, Key$1 extends keyof Type> = IsAny<Type | Key$1> extends true ? never : Key$1 extends keyof Type ? Type extends Record<Key$1, Type[Key$1]> ? false : true : false; | ||
| type IsOptionalKeyOf<Type extends object, Key extends keyof Type> = IsAny<Type | Key> extends true ? never : Key extends keyof Type ? Type extends Record<Key, Type[Key]> ? false : true : false; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/optional-keys-of.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/optional-keys-of.d.ts | ||
| /** | ||
@@ -200,3 +206,3 @@ Extract all optional keys from the given type. | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/required-keys-of.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/required-keys-of.d.ts | ||
| /** | ||
@@ -235,3 +241,3 @@ Extract all required keys from the given type. | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-never.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-never.d.ts | ||
| /** | ||
@@ -277,3 +283,3 @@ Returns a boolean for whether the given type is `never`. | ||
| type A = IsTrue<never>; | ||
| // ^? type A = never | ||
| //=> never | ||
@@ -285,3 +291,3 @@ // If you don't want that behaviour, you can explicitly add an `IsNever` check before the distributive conditional. | ||
| type B = IsTrueFixed<never>; | ||
| // ^? type B = false | ||
| //=> false | ||
| ``` | ||
@@ -292,5 +298,5 @@ | ||
| */ | ||
| type IsNever<T$1> = [T$1] extends [never] ? true : false; | ||
| type IsNever<T> = [T] extends [never] ? true : false; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/if.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/if.d.ts | ||
| /** | ||
@@ -390,3 +396,3 @@ An if-else-like type that resolves depending on whether the given `boolean` type is `true` or `false`. | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/type.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/type.d.ts | ||
| /** | ||
@@ -404,3 +410,3 @@ Matches any primitive, `void`, `Date`, or `RegExp` value. | ||
| */ | ||
| type HasMultipleCallSignatures<T$1 extends (...arguments_: any[]) => unknown> = T$1 extends { | ||
| type HasMultipleCallSignatures<T extends (...arguments_: any[]) => unknown> = T extends { | ||
| (...arguments_: infer A): unknown; | ||
@@ -410,3 +416,3 @@ (...arguments_: infer B): unknown; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/simplify.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/simplify.d.ts | ||
| /** | ||
@@ -470,5 +476,5 @@ Useful to flatten the type output to improve type hints shown in editors. And also to transform an interface into a type to aide with assignability. | ||
| */ | ||
| type Simplify<T$1> = { [KeyType in keyof T$1]: T$1[KeyType] } & {}; | ||
| type Simplify<T> = { [KeyType in keyof T]: T[KeyType] } & {}; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/is-equal.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/is-equal.d.ts | ||
| /** | ||
@@ -504,3 +510,3 @@ Returns a boolean for whether the two given types are equal. | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/omit-index-signature.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/omit-index-signature.d.ts | ||
| /** | ||
@@ -525,3 +531,3 @@ Omit any index signatures from the given object type, leaving only explicitly defined properties. | ||
| const keyed: Record<'foo', unknown> = {}; // Error | ||
| // => TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar | ||
| // TS2739: Type '{}' is missing the following properties from type 'Record<"foo" | "bar", unknown>': foo, bar | ||
| ``` | ||
@@ -535,8 +541,12 @@ | ||
| : '❌ `{}` is NOT assignable to `Record<string, unknown>`'; | ||
| // => '✅ `{}` is assignable to `Record<string, unknown>`' | ||
| type IndexedResult = Indexed; | ||
| //=> '✅ `{}` is assignable to `Record<string, unknown>`' | ||
| type Keyed = {} extends Record<'foo' | 'bar', unknown> | ||
| ? '✅ `{}` is assignable to `Record<\'foo\' | \'bar\', unknown>`' | ||
| : '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`'; | ||
| // => "❌ `{}` is NOT assignable to `Record<'foo' | 'bar', unknown>`" | ||
| type KeyedResult = Keyed; | ||
| //=> '❌ `{}` is NOT assignable to `Record<\'foo\' | \'bar\', unknown>`' | ||
| ``` | ||
@@ -589,3 +599,3 @@ | ||
| type ExampleWithoutIndexSignatures = OmitIndexSignature<Example>; | ||
| // => { foo: 'bar'; qux?: 'baz' | undefined; } | ||
| //=> {foo: 'bar'; qux?: 'baz'} | ||
| ``` | ||
@@ -598,3 +608,3 @@ | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/pick-index-signature.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/pick-index-signature.d.ts | ||
| /** | ||
@@ -647,6 +657,5 @@ Pick only index signatures from the given object type, leaving out all explicitly defined properties. | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/merge.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/merge.d.ts | ||
| // Merges two objects without worrying about index signatures. | ||
| type SimpleMerge<Destination, Source> = { [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source; | ||
| type SimpleMerge<Destination, Source> = Simplify<{ [Key in keyof Destination as Key extends keyof Source ? never : Key]: Destination[Key] } & Source>; | ||
| /** | ||
@@ -674,3 +683,3 @@ Merge two types into a new type. Keys of the second type overrides keys of the first type. | ||
| export type FooBar = Merge<Foo, Bar>; | ||
| // => { | ||
| //=> { | ||
| // [x: string]: unknown; | ||
@@ -685,7 +694,15 @@ // [x: number]: number; | ||
| Note: If you want a merge type that more accurately reflects the runtime behavior of object spread or `Object.assign`, refer to the {@link ObjectMerge} type. | ||
| @see {@link ObjectMerge} | ||
| @category Object | ||
| */ | ||
| type Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>; | ||
| type Merge<Destination, Source> = Destination extends unknown // For distributing `Destination` | ||
| ? Source extends unknown // For distributing `Source` | ||
| ? If<IsEqual<Destination, Source>, Destination, _Merge<Destination, Source>> : never // Should never happen | ||
| : never; | ||
| // Should never happen | ||
| type _Merge<Destination, Source> = Simplify<SimpleMerge<PickIndexSignature<Destination>, PickIndexSignature<Source>> & SimpleMerge<OmitIndexSignature<Destination>, OmitIndexSignature<Source>>>; | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/internal/object.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/internal/object.d.ts | ||
| /** | ||
@@ -745,3 +762,3 @@ Merges user specified options with default options. | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/except.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/except.d.ts | ||
| /** | ||
@@ -774,3 +791,3 @@ Filter out keys from an object. | ||
| */ | ||
| type Filter<KeyType$1, ExcludeType> = IsEqual<KeyType$1, ExcludeType> extends true ? never : (KeyType$1 extends ExcludeType ? never : KeyType$1); | ||
| type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType); | ||
| type ExceptOptions = { | ||
@@ -787,3 +804,2 @@ /** | ||
| }; | ||
| /** | ||
@@ -812,10 +828,10 @@ Create a type from an object type without certain keys. | ||
| const fooWithoutA: FooWithoutA = {a: 1, b: '2'}; | ||
| //=> errors: 'a' does not exist in type '{ b: string; }' | ||
| // errors: 'a' does not exist in type '{ b: string; }' | ||
| type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>; | ||
| //=> {a: number} & Partial<Record<"b", never>> | ||
| //=> {a: number} & Partial<Record<'b', never>> | ||
| // @ts-expect-error | ||
| const fooWithoutB: FooWithoutB = {a: 1, b: '2'}; | ||
| //=> errors at 'b': Type 'string' is not assignable to type 'undefined'. | ||
| // errors at 'b': Type 'string' is not assignable to type 'undefined'. | ||
@@ -835,3 +851,3 @@ // The `Omit` utility type doesn't work when omitting specific keys from objects containing index signatures. | ||
| type PostPayload = Omit<UserData, 'email'>; | ||
| //=> { [x: string]: string; [x: number]: string; } | ||
| //=> {[x: string]: string; [x: number]: string} | ||
@@ -841,3 +857,3 @@ // In situations like this, `Except` works better. | ||
| type PostPayloadFixed = Except<UserData, 'email'>; | ||
| //=> { [x: string]: string; name: string; role: 'admin' | 'user'; } | ||
| //=> {[x: string]: string; name: string; role: 'admin' | 'user'} | ||
| ``` | ||
@@ -850,3 +866,3 @@ | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/type-fest@5.3.1/node_modules/type-fest/source/required-deep.d.ts | ||
| //#region ../../node_modules/.pnpm/type-fest@5.4.3/node_modules/type-fest/source/required-deep.d.ts | ||
| /** | ||
@@ -893,15 +909,16 @@ Create a type from another type with all keys and nested keys set to required. | ||
| */ | ||
| type RequiredDeep<T$1> = T$1 extends BuiltIns ? T$1 : T$1 extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T$1 extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T$1 extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T$1 extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T$1 extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T$1 extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T$1> extends true ? T$1 : HasMultipleCallSignatures<T$1> extends true ? T$1 : ((...arguments_: Parameters<T$1>) => ReturnType<T$1>) & RequiredObjectDeep<T$1> : T$1 extends object ? RequiredObjectDeep<T$1> : unknown; | ||
| type RequiredDeep<T> = T extends BuiltIns ? T : T extends Map<infer KeyType, infer ValueType> ? Map<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends Set<infer ItemType> ? Set<RequiredDeep<ItemType>> : T extends ReadonlyMap<infer KeyType, infer ValueType> ? ReadonlyMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends ReadonlySet<infer ItemType> ? ReadonlySet<RequiredDeep<ItemType>> : T extends WeakMap<infer KeyType, infer ValueType> ? WeakMap<RequiredDeep<KeyType>, RequiredDeep<ValueType>> : T extends WeakSet<infer ItemType> ? WeakSet<RequiredDeep<ItemType>> : T extends Promise<infer ValueType> ? Promise<RequiredDeep<ValueType>> : T extends ((...arguments_: any[]) => unknown) ? IsNever<keyof T> extends true ? T : HasMultipleCallSignatures<T> extends true ? T : ((...arguments_: Parameters<T>) => ReturnType<T>) & RequiredObjectDeep<T> : T extends object ? Simplify<RequiredObjectDeep<T>> // `Simplify` to prevent `RequiredObjectDeep` from appearing in the resulting type | ||
| : unknown; | ||
| type RequiredObjectDeep<ObjectType extends object> = { [KeyType in keyof ObjectType]-?: RequiredDeep<ObjectType[KeyType]> }; | ||
| //#endregion | ||
| //#region src/util/types/PropertyNames.d.ts | ||
| type PropertyNames<T$1> = RequiredDeep<{ [P in keyof T$1]: P }>; | ||
| type PropertyNames<T> = RequiredDeep<{ [P in keyof T]: P }>; | ||
| //#endregion | ||
| //#region src/models/shared/ItemEntityType.d.ts | ||
| interface ItemEntityType<T$1 extends string> { | ||
| type: T$1; | ||
| interface ItemEntityType<T extends string> { | ||
| type: T; | ||
| } | ||
| declare const ItemEntityTypePropertyNames: PropertyNames<ItemEntityType<string>>; | ||
| declare const createItemEntityTypeSchema: <T$1 extends z.ZodType<string>>(schema: T$1) => z.ZodObject<{ | ||
| type: T$1; | ||
| declare const createItemEntityTypeSchema: <T extends z.ZodType<string>>(schema: T) => z.ZodObject<{ | ||
| type: T; | ||
| }>; | ||
@@ -927,2 +944,8 @@ //#endregion | ||
| //#endregion | ||
| //#region src/models/shared/TakeOne.d.ts | ||
| interface TakeOne { | ||
| <T extends readonly unknown[]>(values: T, index?: number): T[number]; | ||
| <T extends Record<PropertyKey, unknown>>(values: T, index: keyof T): T[keyof T]; | ||
| } | ||
| //#endregion | ||
| //#region src/util/types/DeepOmitArray.d.ts | ||
@@ -932,15 +955,15 @@ type DeepOmitArray<TArray extends unknown[], TKey> = { [P in keyof TArray]: DeepOmit<TArray[P], TKey> }; | ||
| //#region src/util/types/DeepOmit.d.ts | ||
| type DeepOmit<T$1, TKey> = T$1 extends Primitive ? T$1 : { [P in Exclude<keyof T$1, TKey>]: T$1[P] extends infer TP ? TP extends Date | Function | Primitive ? TP : TP extends unknown[] ? DeepOmitArray<TP, TKey> : Record<string, unknown> extends TP ? TP : DeepOmit<TP, TKey> : never }; | ||
| type DeepOmit<T, TKey> = T extends Primitive ? T : { [P in Exclude<keyof T, TKey>]: T[P] extends infer TP ? TP extends Date | Function | Primitive ? TP : TP extends unknown[] ? DeepOmitArray<TP, TKey> : Record<string, unknown> extends TP ? TP : DeepOmit<TP, TKey> : never }; | ||
| //#endregion | ||
| //#region src/util/types/DeepOptionalProperties.d.ts | ||
| type DeepOptionalProperties<T$1> = { [K in keyof T$1 as undefined extends T$1[K] ? K : never]?: DeepOptionalProperties<T$1[K]> }; | ||
| type DeepOptionalProperties<T> = { [K in keyof T as undefined extends T[K] ? K : never]?: DeepOptionalProperties<T[K]> }; | ||
| //#endregion | ||
| //#region src/util/types/DeepRequiredProperties.d.ts | ||
| type DeepRequiredProperties<T$1> = { [K in keyof T$1 as undefined extends T$1[K] ? never : K]: DeepRequiredProperties<T$1[K]> }; | ||
| type DeepRequiredProperties<T> = { [K in keyof T as undefined extends T[K] ? never : K]: DeepRequiredProperties<T[K]> }; | ||
| //#endregion | ||
| //#region src/util/types/DeepOptionalUndefined.d.ts | ||
| type DeepOptionalUndefined<T$1> = T$1 extends ((...args: unknown[]) => unknown) ? T$1 : T$1 extends (infer U)[] ? DeepOptionalUndefined<U>[] : T$1 extends readonly (infer U)[] ? readonly DeepOptionalUndefined<U>[] : T$1 extends Date ? T$1 : T$1 extends object ? keyof T$1 extends never ? never : DeepOptionalProperties<T$1> extends Record<never, unknown> ? DeepRequiredProperties<T$1> : DeepRequiredProperties<T$1> extends Record<never, unknown> ? DeepOptionalProperties<T$1> : DeepOptionalProperties<T$1> & DeepRequiredProperties<T$1> : T$1; | ||
| type DeepOptionalUndefined<T> = T extends ((...args: unknown[]) => unknown) ? T : T extends (infer U)[] ? DeepOptionalUndefined<U>[] : T extends readonly (infer U)[] ? readonly DeepOptionalUndefined<U>[] : T extends Date ? T : T extends object ? keyof T extends never ? never : DeepOptionalProperties<T> extends Record<never, unknown> ? DeepRequiredProperties<T> : DeepRequiredProperties<T> extends Record<never, unknown> ? DeepOptionalProperties<T> : DeepOptionalProperties<T> & DeepRequiredProperties<T> : T; | ||
| //#endregion | ||
| //#region src/models/shared/ToData.d.ts | ||
| type ToData<T$1 extends Serializable> = DeepOptionalUndefined<DeepOmit<T$1, "toJSON">>; | ||
| type ToData<T extends Serializable> = DeepOptionalUndefined<DeepOmit<T, "toJSON">>; | ||
| //#endregion | ||
@@ -962,2 +985,290 @@ //#region src/models/shared/WithMetadata.d.ts | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/void-tag.d.ts | ||
| declare class VoidTag { | ||
| addClosingSlash: boolean; | ||
| private voidTags; | ||
| constructor(addClosingSlash?: boolean, tags?: string[]); | ||
| formatNode(tag: string, attrs: string, innerHTML: string): string; | ||
| isVoidElement(tag: string): boolean; | ||
| } | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/nodes/type.d.ts | ||
| declare enum NodeType { | ||
| ELEMENT_NODE = 1, | ||
| TEXT_NODE = 3, | ||
| COMMENT_NODE = 8 | ||
| } | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/nodes/node.d.ts | ||
| /** | ||
| * Node Class as base class for TextNode and HTMLElement. | ||
| */ | ||
| declare abstract class Node { | ||
| parentNode: HTMLElement; | ||
| abstract rawTagName: string; | ||
| abstract nodeType: NodeType; | ||
| childNodes: Node[]; | ||
| range: readonly [number, number]; | ||
| abstract text: string; | ||
| abstract rawText: string; | ||
| abstract toString(): string; | ||
| abstract clone(): Node; | ||
| constructor(parentNode?: HTMLElement, range?: [number, number]); | ||
| /** | ||
| * Remove current node | ||
| */ | ||
| remove(): this; | ||
| get innerText(): string; | ||
| get textContent(): string; | ||
| set textContent(val: string); | ||
| } | ||
| //#endregion | ||
| //#region ../../node_modules/.pnpm/node-html-parser@7.0.2/node_modules/node-html-parser/dist/nodes/html.d.ts | ||
| interface KeyAttributes { | ||
| id?: string; | ||
| class?: string; | ||
| } | ||
| interface Attributes { | ||
| [key: string]: string; | ||
| } | ||
| interface RawAttributes { | ||
| [key: string]: string; | ||
| } | ||
| type InsertPosition = 'beforebegin' | 'afterbegin' | 'beforeend' | 'afterend'; | ||
| type NodeInsertable = Node | string; | ||
| declare class DOMTokenList { | ||
| private _set; | ||
| private _afterUpdate; | ||
| private _validate; | ||
| constructor(valuesInit?: string[], afterUpdate?: (t: DOMTokenList) => void); | ||
| add(c: string): void; | ||
| replace(c1: string, c2: string): void; | ||
| remove(c: string): void; | ||
| toggle(c: string): void; | ||
| contains(c: string): boolean; | ||
| get length(): number; | ||
| values(): IterableIterator<string>; | ||
| get value(): string[]; | ||
| toString(): string; | ||
| } | ||
| /** | ||
| * HTMLElement, which contains a set of children. | ||
| * | ||
| * Note: this is a minimalist implementation, no complete tree | ||
| * structure provided (no parentNode, nextSibling, | ||
| * previousSibling etc). | ||
| * @class HTMLElement | ||
| * @extends {Node} | ||
| */ | ||
| declare class HTMLElement extends Node { | ||
| rawAttrs: string; | ||
| private voidTag; | ||
| private _attrs; | ||
| private _rawAttrs; | ||
| private _parseOptions; | ||
| private _id; | ||
| rawTagName: string; | ||
| classList: DOMTokenList; | ||
| /** | ||
| * Node Type declaration. | ||
| */ | ||
| nodeType: NodeType; | ||
| /** | ||
| * Quote attribute values | ||
| * @param attr attribute value | ||
| * @returns {string} quoted value | ||
| */ | ||
| private quoteAttribute; | ||
| /** | ||
| * Creates an instance of HTMLElement. | ||
| * @param keyAttrs id and class attribute | ||
| * @param [rawAttrs] attributes in string | ||
| * | ||
| * @memberof HTMLElement | ||
| */ | ||
| constructor(tagName: string, keyAttrs: KeyAttributes, rawAttrs?: string, parentNode?: HTMLElement, range?: [number, number], voidTag?: VoidTag, _parseOptions?: Partial<Options>); | ||
| /** | ||
| * Remove Child element from childNodes array | ||
| * @param {HTMLElement} node node to remove | ||
| */ | ||
| removeChild(node: Node): this; | ||
| /** | ||
| * Exchanges given child with new child | ||
| * @param {HTMLElement} oldNode node to exchange | ||
| * @param {HTMLElement} newNode new node | ||
| */ | ||
| exchangeChild(oldNode: Node, newNode: Node): this; | ||
| get tagName(): string; | ||
| set tagName(newname: string); | ||
| get localName(): string; | ||
| get isVoidElement(): boolean; | ||
| get id(): string; | ||
| set id(newid: string); | ||
| /** | ||
| * Get escpaed (as-it) text value of current node and its children. | ||
| * @return {string} text content | ||
| */ | ||
| get rawText(): string; | ||
| get textContent(): string; | ||
| set textContent(val: string); | ||
| /** | ||
| * Get unescaped text value of current node and its children. | ||
| * @return {string} text content | ||
| */ | ||
| get text(): string; | ||
| /** | ||
| * Get structured Text (with '\n' etc.) | ||
| * @return {string} structured text | ||
| */ | ||
| get structuredText(): string; | ||
| toString(): string; | ||
| get innerHTML(): string; | ||
| set innerHTML(content: string); | ||
| set_content(content: string | Node | Node[], options?: Partial<Options>): this; | ||
| replaceWith(...nodes: (string | Node)[]): this; | ||
| get outerHTML(): string; | ||
| /** | ||
| * Trim element from right (in block) after seeing pattern in a TextNode. | ||
| * @param {RegExp} pattern pattern to find | ||
| * @return {HTMLElement} reference to current node | ||
| */ | ||
| trimRight(pattern: RegExp): this; | ||
| /** | ||
| * Get DOM structure | ||
| * @return {string} structure | ||
| */ | ||
| get structure(): string; | ||
| /** | ||
| * Remove whitespaces in this sub tree. | ||
| * @return {HTMLElement} pointer to this | ||
| */ | ||
| removeWhitespace(): this; | ||
| /** | ||
| * Query CSS selector to find matching nodes. | ||
| * @param {string} selector Simplified CSS selector | ||
| * @return {HTMLElement[]} matching elements | ||
| */ | ||
| querySelectorAll(selector: string): HTMLElement[]; | ||
| /** | ||
| * Query CSS Selector to find matching node. | ||
| * @param {string} selector Simplified CSS selector | ||
| * @return {(HTMLElement|null)} matching node | ||
| */ | ||
| querySelector(selector: string): HTMLElement | null; | ||
| /** | ||
| * find elements by their tagName | ||
| * @param {string} tagName the tagName of the elements to select | ||
| */ | ||
| getElementsByTagName(tagName: string): Array<HTMLElement>; | ||
| /** | ||
| * find element by it's id | ||
| * @param {string} id the id of the element to select | ||
| * @returns {HTMLElement | null} the element with the given id or null if not found | ||
| */ | ||
| getElementById(id: string): HTMLElement | null; | ||
| /** | ||
| * traverses the Element and its parents (heading toward the document root) until it finds a node that matches the provided selector string. Will return itself or the matching ancestor. If no such element exists, it returns null. | ||
| * @param selector a DOMString containing a selector list | ||
| * @returns {HTMLElement | null} the element with the given id or null if not found | ||
| */ | ||
| closest(selector: string): HTMLElement | null; | ||
| /** | ||
| * Append a child node to childNodes | ||
| * @param {Node} node node to append | ||
| * @return {Node} node appended | ||
| */ | ||
| appendChild<T extends Node = Node>(node: T): T; | ||
| /** | ||
| * Get attributes | ||
| * @access private | ||
| * @return {Object} parsed and unescaped attributes | ||
| */ | ||
| get attrs(): Attributes; | ||
| get attributes(): Record<string, string>; | ||
| /** | ||
| * Get escaped (as-is) attributes | ||
| * @return {Object} parsed attributes | ||
| */ | ||
| get rawAttributes(): RawAttributes; | ||
| removeAttribute(key: string): this; | ||
| hasAttribute(key: string): boolean; | ||
| /** | ||
| * Get an attribute | ||
| * @return {string | undefined} value of the attribute; or undefined if not exist | ||
| */ | ||
| getAttribute(key: string): string | undefined; | ||
| /** | ||
| * Set an attribute value to the HTMLElement | ||
| * @param {string} key The attribute name | ||
| * @param {string} value The value to set, or null / undefined to remove an attribute | ||
| */ | ||
| setAttribute(key: string, value: string): this; | ||
| /** | ||
| * Replace all the attributes of the HTMLElement by the provided attributes | ||
| * @param {Attributes} attributes the new attribute set | ||
| */ | ||
| setAttributes(attributes: Attributes): this; | ||
| insertAdjacentHTML(where: InsertPosition, html: string): this; | ||
| /** Prepend nodes or strings to this node's children. */ | ||
| prepend(...insertable: NodeInsertable[]): void; | ||
| /** Append nodes or strings to this node's children. */ | ||
| append(...insertable: NodeInsertable[]): void; | ||
| /** Insert nodes or strings before this node. */ | ||
| before(...insertable: NodeInsertable[]): void; | ||
| /** Insert nodes or strings after this node. */ | ||
| after(...insertable: NodeInsertable[]): void; | ||
| get nextSibling(): Node | null; | ||
| get nextElementSibling(): HTMLElement | null; | ||
| get previousSibling(): Node | null; | ||
| get previousElementSibling(): HTMLElement | null; | ||
| /** Get all childNodes of type {@link HTMLElement}. */ | ||
| get children(): HTMLElement[]; | ||
| /** | ||
| * Get the first child node. | ||
| * @return The first child or undefined if none exists. | ||
| */ | ||
| get firstChild(): Node | undefined; | ||
| /** | ||
| * Get the first child node of type {@link HTMLElement}. | ||
| * @return The first child element or undefined if none exists. | ||
| */ | ||
| get firstElementChild(): HTMLElement | undefined; | ||
| /** | ||
| * Get the last child node. | ||
| * @return The last child or undefined if none exists. | ||
| */ | ||
| get lastChild(): Node | undefined; | ||
| /** | ||
| * Get the last child node of type {@link HTMLElement}. | ||
| * @return The last child element or undefined if none exists. | ||
| */ | ||
| get lastElementChild(): HTMLElement | undefined; | ||
| get childElementCount(): number; | ||
| get classNames(): string; | ||
| /** Clone this Node */ | ||
| clone(): Node; | ||
| } | ||
| interface Options { | ||
| lowerCaseTagName?: boolean; | ||
| comment?: boolean; | ||
| /** | ||
| * @see PR #215 for explanation | ||
| */ | ||
| fixNestedATags?: boolean; | ||
| parseNoneClosedTags?: boolean; | ||
| blockTextElements: { | ||
| [tag: string]: boolean; | ||
| }; | ||
| voidTag?: { | ||
| /** | ||
| * options, default value is ['area', 'base', 'br', 'col', 'embed', 'hr', 'img', 'input', 'link', 'meta', 'param', 'source', 'track', 'wbr'] | ||
| */ | ||
| tags?: string[]; | ||
| /** | ||
| * void tag serialisation, add a final slash <br/> | ||
| */ | ||
| closingSlash?: boolean; | ||
| }; | ||
| } | ||
| //#endregion | ||
| //#region src/services/message/getMentions.d.ts | ||
@@ -978,2 +1289,5 @@ declare const getMentions: (message: string) => HTMLElement[]; | ||
| //#endregion | ||
| //#region src/util/array/takeOne.d.ts | ||
| declare const takeOne: TakeOne; | ||
| //#endregion | ||
| //#region src/util/environment/getIsServer.d.ts | ||
@@ -986,3 +1300,3 @@ declare const getIsServer: () => boolean; | ||
| //#region src/util/object/getPropertyNames.d.ts | ||
| declare const getPropertyNames: <T$1>() => PropertyNames<T$1>; | ||
| declare const getPropertyNames: <T>() => PropertyNames<T>; | ||
| //#endregion | ||
@@ -996,12 +1310,12 @@ //#region src/util/object/isPlainObject.d.ts | ||
| //#region src/util/types/MergeObjectsStrict.d.ts | ||
| type MergeObjectsStrict<T$1 extends object[]> = T$1 extends [infer TFirst, infer TSecond, ...infer TRemaining] ? TSecond extends { [K in keyof TSecond]: K extends keyof TFirst ? never : TSecond[K] } ? TRemaining extends object[] ? MergeObjectsStrict<[TSecond, ...TRemaining]> & TFirst : TFirst & TSecond : never : T$1 extends [infer TFirst] ? TFirst : never; | ||
| type MergeObjectsStrict<T extends object[]> = T extends [infer TFirst, infer TSecond, ...infer TRemaining] ? TSecond extends { [K in keyof TSecond]: K extends keyof TFirst ? never : TSecond[K] } ? TRemaining extends object[] ? MergeObjectsStrict<[TSecond, ...TRemaining]> & TFirst : TFirst & TSecond : never : T extends [infer TFirst] ? TFirst : never; | ||
| //#endregion | ||
| //#region src/util/object/mergeObjectsStrict.d.ts | ||
| declare const mergeObjectsStrict: <T$1 extends object[]>(...objects: T$1) => MergeObjectsStrict<T$1>; | ||
| declare const mergeObjectsStrict: <T extends object[]>(...objects: T) => MergeObjectsStrict<T>; | ||
| //#endregion | ||
| //#region src/util/reactivity/getRawData.d.ts | ||
| declare const getRawData: <T$1>(data: T$1) => T$1; | ||
| declare const getRawData: <T>(data: T) => T; | ||
| //#endregion | ||
| //#region src/util/reactivity/toRawDeep.d.ts | ||
| declare const toRawDeep: <T$1 extends object>(data: T$1) => T$1; | ||
| declare const toRawDeep: <T extends object>(data: T) => T; | ||
| //#endregion | ||
@@ -1021,3 +1335,3 @@ //#region src/util/regex/escapeRegExp.d.ts | ||
| //#region src/util/text/toKebabCase.d.ts | ||
| declare const toKebabCase: <T$1 extends string>(string: T$1) => CamelToKebab<T$1>; | ||
| declare const toKebabCase: <T extends string>(string: T) => CamelToKebab<T>; | ||
| //#endregion | ||
@@ -1028,3 +1342,3 @@ //#region src/util/text/truncate.d.ts | ||
| //#region src/util/text/uncapitalize.d.ts | ||
| declare const uncapitalize: <T$1 extends string>(string: T$1) => Uncapitalize<T$1>; | ||
| declare const uncapitalize: <T extends string>(string: T) => Uncapitalize<T>; | ||
| //#endregion | ||
@@ -1038,6 +1352,6 @@ //#region src/util/time/hrtime.d.ts | ||
| //#region src/util/types/FunctionProperties.d.ts | ||
| type FunctionProperties<T$1> = { [K in keyof T$1]: T$1[K] extends Function ? K : never }; | ||
| type FunctionProperties<T> = { [K in keyof T]: T[K] extends Function ? K : never }; | ||
| //#endregion | ||
| //#region src/util/types/ExcludeFunctionProperties.d.ts | ||
| type ExcludeFunctionProperties<T$1> = Except<T$1, FunctionProperties<T$1>[keyof T$1]>; | ||
| type ExcludeFunctionProperties<T> = Except<T, FunctionProperties<T>[keyof T]>; | ||
| //#endregion | ||
@@ -1051,21 +1365,21 @@ //#region src/util/types/KebabToCamel.d.ts | ||
| //#region src/util/types/PartialByKeys.d.ts | ||
| type PartialByKeys<T$1, K$1 extends keyof T$1 = keyof T$1> = Except<T$1, K$1> & Partial<Pick<T$1, Extract<keyof T$1, K$1>>>; | ||
| type PartialByKeys<T, K extends keyof T = keyof T> = Except<T, K> & Partial<Pick<T, Extract<keyof T, K>>>; | ||
| //#endregion | ||
| //#region src/util/types/TupleSplitHead.d.ts | ||
| type TupleSplitHead<T$1 extends unknown[], N extends number> = T$1["length"] extends N ? T$1 : T$1 extends [...infer R, unknown] ? TupleSplitHead<R, N> : never; | ||
| type TupleSplitHead<T extends unknown[], N extends number> = T["length"] extends N ? T : T extends [...infer R, unknown] ? TupleSplitHead<R, N> : never; | ||
| //#endregion | ||
| //#region src/util/types/TupleSplitTail.d.ts | ||
| type TupleSplitTail<T$1, N extends number, O extends unknown[] = []> = O["length"] extends N ? T$1 : T$1 extends [infer F, ...infer R] ? TupleSplitTail<[...R], N, [...O, F]> : never; | ||
| type TupleSplitTail<T, N extends number, O extends unknown[] = []> = O["length"] extends N ? T : T extends [infer F, ...infer R] ? TupleSplitTail<[...R], N, [...O, F]> : never; | ||
| //#endregion | ||
| //#region src/util/types/TupleSplit.d.ts | ||
| type TupleSplit<T$1 extends unknown[], N extends number> = [TupleSplitHead<T$1, N>, TupleSplitTail<T$1, N>]; | ||
| type TupleSplit<T extends unknown[], N extends number> = [TupleSplitHead<T, N>, TupleSplitTail<T, N>]; | ||
| //#endregion | ||
| //#region src/util/types/SkipFirst.d.ts | ||
| type SkipFirst<T$1 extends unknown[], N extends number> = TupleSplit<T$1, N>[1]; | ||
| type SkipFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[1]; | ||
| //#endregion | ||
| //#region src/util/types/TakeFirst.d.ts | ||
| type TakeFirst<T$1 extends unknown[], N extends number> = TupleSplit<T$1, N>[0]; | ||
| type TakeFirst<T extends unknown[], N extends number> = TupleSplit<T, N>[0]; | ||
| //#endregion | ||
| //#region src/util/types/TupleSlice.d.ts | ||
| type TupleSlice<T$1 extends unknown[], S extends number, E extends number = T$1["length"]> = SkipFirst<TakeFirst<T$1, E>, S>; | ||
| type TupleSlice<T extends unknown[], S extends number, E extends number = T["length"]> = SkipFirst<TakeFirst<T, E>, S>; | ||
| //#endregion | ||
@@ -1082,2 +1396,2 @@ //#region src/util/validation/exhaustiveGuard.d.ts | ||
| //#endregion | ||
| export { CamelToKebab, DeepOmit, DeepOmitArray, DeepOptionalProperties, DeepOptionalUndefined, DeepRequiredProperties, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KebabToCamel, MENTION_ID_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PartialByKeys, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, now, streamToText, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4 }; | ||
| export { AllSpecialValues, CamelToKebab, DeepOmit, DeepOmitArray, DeepOptionalProperties, DeepOptionalUndefined, DeepRequiredProperties, ExcludeFunctionProperties, FunctionProperties, ID_SEPARATOR, InvalidOperationError, ItemEntityType, ItemEntityTypePropertyNames, ItemMetadata, ItemMetadataPropertyNames, KebabToCamel, MENTION_ID_ATTRIBUTE, MENTION_LABEL_ATTRIBUTE, MENTION_TYPE, MENTION_TYPE_ATTRIBUTE, MapValue, MergeObjectsStrict, NIL, NotFoundError, NotInitializedError, Operation, PartialByKeys, PropertyNames, RoutePath, SITE_NAME, SURVEY_DISPLAY_NAME, Serializable, SkipFirst, TakeFirst, TakeOne, ToData, TupleSlice, TupleSplit, TupleSplitHead, TupleSplitTail, UUIDV4_REGEX, WithMetadata, applyItemMetadataMixin, capitalize, createItemEntityTypeSchema, css, escapeRegExp, exhaustiveGuard, getIsServer, getMentions, getPropertyNames, getRawData, hrtime, html, isPlainObject, itemMetadataSchema, jsonDateParse, mergeObjectsStrict, now, streamToText, takeOne, toKebabCase, toRawDeep, truncate, uncapitalize, uuidValidateV4 }; |
+16
-16
| { | ||
| "name": "@esposter/shared", | ||
| "version": "2.19.2", | ||
| "description": "A library that contains shared typescript code.", | ||
| "version": "2.18.2", | ||
| "type": "module", | ||
| "homepage": "https://github.com/Esposter/Esposter/blob/main/packages/shared#readme", | ||
| "bugs": { | ||
| "url": "https://github.com/Esposter/Esposter/issues" | ||
| }, | ||
| "license": "Apache-2.0", | ||
| "author": "Jimmy Chen", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/Esposter/Esposter.git" | ||
| }, | ||
| "files": [ | ||
| "dist" | ||
| ], | ||
| "type": "module", | ||
| "main": "dist/index.js", | ||
| "types": "dist/index.d.ts", | ||
| "publishConfig": { | ||
| "access": "public" | ||
| }, | ||
| "repository": { | ||
| "type": "git", | ||
| "url": "git+https://github.com/Esposter/Esposter.git" | ||
| }, | ||
| "bugs": { | ||
| "url": "https://github.com/Esposter/Esposter/issues" | ||
| }, | ||
| "scripts": { | ||
@@ -34,6 +34,6 @@ "build": "pnpm export:gen && rolldown --config rolldown.config.ts", | ||
| "dependencies": { | ||
| "@vueuse/core": "^14.1.0", | ||
| "node-html-parser": "^7.0.1", | ||
| "vue": "^3.5.25", | ||
| "zod": "^4.1.13" | ||
| "@vueuse/core": "^14.2.0", | ||
| "node-html-parser": "^7.0.2", | ||
| "vue": "^3.5.27", | ||
| "zod": "^4.3.6" | ||
| }, | ||
@@ -43,3 +43,3 @@ "devDependencies": { | ||
| }, | ||
| "gitHead": "f56a34ad2c323421680d2a10f7fc4b64247d64a9" | ||
| "gitHead": "2d39052b4767fba8fd2e1798202645161f45cb2c" | ||
| } |
Sorry, the diff of this file is too big to display
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
511187
2.22%15814
2.56%47
4.44%Updated
Updated
Updated
Updated