Skip to content

Commit

Permalink
Update docs for window and tabwindow
Browse files Browse the repository at this point in the history
  • Loading branch information
Basssiiie committed Nov 23, 2024
1 parent 306ad4a commit 6042c5a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 15 deletions.
21 changes: 13 additions & 8 deletions src/windows/tabs/tabWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,24 +62,29 @@ export interface TabWindowParams extends BaseWindowParams
/**
* Create a new flexiblely designed window that has tabs. An arrow function can be used to create windows to fit a specific viewmodel.
*
* @example <caption>Create a simple window</caption>
*
* @example
* const template = tabwindow({ title: "Hello world!" })
*
* template.open()
*
* @example <caption>Create a window based on a viewmodel</caption>
*
*/
export function tabwindow(params: TabWindowParams): WindowTemplate<void>;
/**
* Create a new flexiblely designed window that has tabs. An arrow function can be used to create windows to fit a specific viewmodel.
* *
* @example
* class MyModel
* {
* header: store("Hello world!")
* };
* const template = tabwindow<MyModel>(model => ({ title: model.header }))
*
* const template = tabwindow<MyModel>(model =>
* ({
* title: model.header
* }))
*
* template.open(new MyModel())
*/
export function tabwindow<TModel>(params: (model: TModel) => TabWindowParams): WindowTemplate<TModel>;
export function tabwindow(params: TabWindowParams): WindowTemplate<void>;
export function tabwindow<TModel extends object>(params: (model: TModel) => TabWindowParams): WindowTemplate<TModel>;
export function tabwindow<T>(params: ((model: T) => TabWindowParams) | TabWindowParams): WindowTemplate<T>
{
Log.debug("tabwindow() started");
Expand Down
19 changes: 12 additions & 7 deletions src/windows/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,24 +31,29 @@ export interface WindowParams extends BaseWindowParams, FlexibleDirectionalLayou
/**
* Create a new flexiblely designed window.
*
* @example <caption>Create a simple window</caption>
*
* @example
* const template = window({ title: "Hello world!" })
*
* template.open()
*/
export function window(params: WindowParams): WindowTemplate<void>;
/**
* Create a new flexiblely designed window with a viewmodel.
*
* @example <caption>Create a window based on a viewmodel</caption>
*
* @example
* class MyModel
* {
* header: store("Hello world!")
* };
* const template = window<MyModel>(model => ({ title: model.header }))
*
* const template = window<MyModel>(model =>
* ({
* title: model.header
* }))
*
* template.open(new MyModel())
*/
export function window<TModel>(params: (model: TModel) => WindowParams): WindowTemplate<TModel>;
export function window(params: WindowParams): WindowTemplate<void>;
export function window<TModel extends object>(params: (model: TModel) => WindowParams): WindowTemplate<TModel>;
export function window<T>(params: ((model: T) => WindowParams) | WindowParams): WindowTemplate<T>
{
Log.debug("window() started");
Expand Down

0 comments on commit 6042c5a

Please sign in to comment.