element-book 7.0.4 → 7.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/book-entry/book-element-example/book-element-example.d.ts +5 -6
- package/dist/data/book-entry/book-entry.d.ts +1 -1
- package/dist/data/book-entry/book-page/book-page-controls.d.ts +2 -2
- package/dist/data/book-tree/book-tree.d.ts +2 -2
- package/dist/ui/elements/element-book-app/element-book-config.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { Overwrite, RequireNonVoid } from '@augment-vir/common';
|
|
1
|
+
import { Overwrite, RequireNonVoid, SetOptionalAndNullable } from '@augment-vir/common';
|
|
2
2
|
import { PropertyInitMapBase, RenderParams, TypedEvent } from 'element-vir';
|
|
3
3
|
import { CSSResult } from 'lit';
|
|
4
|
-
import { SetOptional } from 'type-fest';
|
|
5
4
|
import { BaseBookEntry } from '../base-book-entry';
|
|
6
5
|
import { BookEntryTypeEnum } from '../book-entry-type';
|
|
7
6
|
import { BookPage } from '../book-page/book-page';
|
|
@@ -14,14 +13,14 @@ export type BookElementExample<ControlsInit extends BookPageControlsInitBase = {
|
|
|
14
13
|
entryType: BookEntryTypeEnum.ElementExample;
|
|
15
14
|
} & {
|
|
16
15
|
/** Initialize the state for this example. */
|
|
17
|
-
stateInitStatic?: StateInit;
|
|
16
|
+
stateInitStatic?: StateInit | undefined;
|
|
18
17
|
/** Specify which events this example should intercept (so the user can see them). */
|
|
19
|
-
showEvents?: ReadonlyArray<string | TypedEvent
|
|
18
|
+
showEvents?: ReadonlyArray<string | TypedEvent> | undefined;
|
|
20
19
|
/**
|
|
21
20
|
* Style the element example. You can even use the :host selector to style this specific
|
|
22
21
|
* example's wrapper element!
|
|
23
22
|
*/
|
|
24
|
-
styles?: CSSResult;
|
|
23
|
+
styles?: CSSResult | undefined;
|
|
25
24
|
/** Render the example. */
|
|
26
25
|
renderCallback: RequireNonVoid<RenderOutput, (renderParams: BookPageExampleRenderParams<ControlsInit, StateInit>) => RenderOutput, 'renderCallback is missing a return statement'>;
|
|
27
26
|
}>;
|
|
@@ -29,4 +28,4 @@ export type BookElementExample<ControlsInit extends BookPageControlsInitBase = {
|
|
|
29
28
|
* The properties that are necessary to initialize an element example. Missing properties will be
|
|
30
29
|
* filling in by the parent.
|
|
31
30
|
*/
|
|
32
|
-
export type BookElementExampleInit<Controls extends BookPageControlsInitBase, StateInit extends PropertyInitMapBase, RenderOutput> =
|
|
31
|
+
export type BookElementExampleInit<Controls extends BookPageControlsInitBase, StateInit extends PropertyInitMapBase, RenderOutput> = SetOptionalAndNullable<Omit<BookElementExample<Controls, StateInit, RenderOutput>, 'entryType' | 'parent' | 'errors'>, 'descriptionParagraphs'>;
|
|
@@ -3,6 +3,6 @@ import { BookEntryTypeEnum } from './book-entry-type';
|
|
|
3
3
|
import { BookPage } from './book-page/book-page';
|
|
4
4
|
import { BookRoot } from './book-root';
|
|
5
5
|
export type BookEntry = BookPage | BookRoot | BookElementExample;
|
|
6
|
-
export declare function isBookEntry<SpecificType extends BookEntryTypeEnum>(entry: unknown, entryType: SpecificType): entry is Extract<BookEntry, {
|
|
6
|
+
export declare function isBookEntry<const SpecificType extends BookEntryTypeEnum>(entry: unknown, entryType: SpecificType): entry is Extract<BookEntry, {
|
|
7
7
|
entryType: SpecificType;
|
|
8
8
|
}>;
|
|
@@ -7,12 +7,12 @@ export type BookPageControl<ControlType extends BookPageControlTypeEnum = BookPa
|
|
|
7
7
|
options: string[];
|
|
8
8
|
} : {});
|
|
9
9
|
export type BookPageControlInit<ControlType extends BookPageControlTypeEnum> = Omit<BookPageControl<ControlType>, 'controlName'>;
|
|
10
|
-
export declare function isControlInitType<SpecificControlType extends BookPageControlTypeEnum>(controlInit: BookPageControlInit<any>, specificType: SpecificControlType): controlInit is BookPageControlInit<SpecificControlType>;
|
|
10
|
+
export declare function isControlInitType<const SpecificControlType extends BookPageControlTypeEnum>(controlInit: BookPageControlInit<any>, specificType: SpecificControlType): controlInit is BookPageControlInit<SpecificControlType>;
|
|
11
11
|
/**
|
|
12
12
|
* Define a page control. This doesn't do anything fancy (in fact it only returns the input) but it
|
|
13
13
|
* helps immensely with type inference.
|
|
14
14
|
*/
|
|
15
|
-
export declare function definePageControl<ControlType extends BookPageControlTypeEnum>(controlInit: BookPageControlInit<ControlType>): BookPageControlInit<ControlType>;
|
|
15
|
+
export declare function definePageControl<const ControlType extends BookPageControlTypeEnum>(controlInit: BookPageControlInit<ControlType>): BookPageControlInit<ControlType>;
|
|
16
16
|
export type ControlsToValues<ControlsInit extends BookPageControlsInitBase> = {
|
|
17
17
|
[ControlName in keyof ControlsInit]: ControlsInit[ControlName]['initValue'];
|
|
18
18
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { BookEntry } from '../book-entry/book-entry';
|
|
2
2
|
import { BookEntryTypeEnum } from '../book-entry/book-entry-type';
|
|
3
3
|
import { BookTree, BookTreeNode } from './book-tree-node';
|
|
4
|
-
export declare function doesNodeHaveEntryType<EntryType extends BookEntryTypeEnum>(node: BookTreeNode<any>, entryType: EntryType): node is BookTreeNode<EntryType>;
|
|
5
|
-
export declare function isBookTreeNode<SpecificType extends BookEntryTypeEnum>(input: unknown, entryType: SpecificType): input is BookTreeNode<SpecificType>;
|
|
4
|
+
export declare function doesNodeHaveEntryType<const EntryType extends BookEntryTypeEnum>(node: BookTreeNode<any>, entryType: EntryType): node is BookTreeNode<EntryType>;
|
|
5
|
+
export declare function isBookTreeNode<const SpecificType extends BookEntryTypeEnum>(input: unknown, entryType: SpecificType): input is BookTreeNode<SpecificType>;
|
|
6
6
|
export declare function isAnyBookTreeNode(input: unknown): input is BookTreeNode<BookEntryTypeEnum>;
|
|
7
7
|
export declare function createEmptyBookTreeRoot(title: string | undefined, descriptionParagraphs: ReadonlyArray<string>): BookTreeNode<BookEntryTypeEnum.Root>;
|
|
8
8
|
export declare function createBookTreeFromEntries({ entries, everythingTitle, everythingDescriptionParagraphs, debug, }: {
|
|
@@ -27,7 +27,7 @@ type OptionalConfig = {
|
|
|
27
27
|
* Path to this page, used for routing. For example, if this page is hosted at
|
|
28
28
|
* www.example.org/my-page then this value should be `my-page`.
|
|
29
29
|
*/
|
|
30
|
-
basePath?: string;
|
|
30
|
+
basePath?: string | undefined;
|
|
31
31
|
};
|
|
32
32
|
/**
|
|
33
33
|
* Current route paths for element-book to handle. These are intended to come from a router
|