# Type alias ViewTemplate

ViewTemplate: {
authorise_get?: ((opts, queries) => Promise<boolean>);
authorise_post?: ((opts, queries) => Promise<boolean>);
configCheck?: ((cfg) => Promise<string[] | {
errors: string[];
warnings: string[];
}>);
configuration_workflow?: ((req) => AbstractWorkflow);
connectedObjects?: ((configuration?) => Promise<ConnectedObjects>);
default_state_form?: ((arg0) => any);
description?: string;
getStringsForI18n?: ((configuration?) => string[]);
get_state_fields?: ((table_id, viewname, configuration) => Promise<FieldLike[]> | FieldLike[]);
initial_config?: ((arg0) => Promise<any>);
interpolate_title_string?: ((table_id, title, query) => Promise<string>);
name: string;
on_delete?: ((table_id, viewname, configuration) => Promise<void>);
openDataStream?: ((table_id, viewName, id, fieldName, fieldView, user, configuration, targetOpts) => Promise<any>);
queries?: ((configuration?, req?) => Record<string, any>);
renderRows?: ((table, viewname, { columns, layout }, extra, rows, state) => Promise<string[]>);
routes?: Record<string, RouteAction>;
run: ((table_id, viewname, opts, state, arg4, queries) => Promise<string>);
runMany?: ((table_id, viewname, { columns, layout }, state, extra, queries) => Promise<string[]>);
runPost?: ((table_id, viewname, optsOne, state, body, extraArgs, queries, remote?) => Promise<void>);
singleton?: boolean;
table_optional?: boolean;
tableless?: boolean;
view_quantity?: "Many" | "ZeroOrOne" | "One";
virtual_triggers?: ((table_id, name, configuration) => Promise<AbstractTrigger[]>);
}

#### Type declaration

- ##### `Optional` authorise_get?: ((opts, queries) => Promise<boolean>)

  - - (opts, queries): Promise<boolean>

    - #### Parameters

      - ##### opts: {
        query: any;
        req: NonNullable<any>;
        table_id: number;
        }

        - ##### query: any

        - ##### req: NonNullable<any>

        - ##### table_id: number

      - ##### queries: any

      #### Returns Promise<boolean>

- ##### `Optional` authorise_post?: ((opts, queries) => Promise<boolean>)

  - - (opts, queries): Promise<boolean>

    - #### Parameters

      - ##### opts: {
        body: any;
        req: NonNullable<any>;
        table_id: number;
        }

        - ##### body: any

        - ##### req: NonNullable<any>

        - ##### table_id: number

      - ##### queries: any

      #### Returns Promise<boolean>

- ##### `Optional` configCheck?: ((cfg) => Promise<string[] | {
  errors: string[];
  warnings: string[];
  }>)

  - - (cfg): Promise<string[] | {
      errors: string[];
      warnings: string[];
      }>

    - #### Parameters

      - ##### cfg: any

      #### Returns Promise<string[] | {
      errors: string[];
      warnings: string[];
      }>

- ##### `Optional` configuration_workflow?: ((req) => AbstractWorkflow)

  - - (req): AbstractWorkflow

    - #### Parameters

      - ##### req: Req

      #### Returns AbstractWorkflow

- ##### `Optional` connectedObjects?: ((configuration?) => Promise<ConnectedObjects>)

  - - (configuration?): Promise<ConnectedObjects>

    - #### Parameters

      - ##### `Optional` configuration: any

      #### Returns Promise<ConnectedObjects>

- ##### `Optional` default_state_form?: ((arg0) => any)

  - - (arg0): any

    - #### Parameters

      - ##### arg0: {
        default_state: any;
        }

        - ##### default_state: any

      #### Returns any

- ##### `Optional` description?: string

- ##### `Optional` getStringsForI18n?: ((configuration?) => string[])

  - - (configuration?): string[]

    - #### Parameters

      - ##### `Optional` configuration: any

      #### Returns string[]

- ##### `Optional` get_state_fields?: ((table_id, viewname, configuration) => Promise<FieldLike[]> | FieldLike[])

  - - (table_id, viewname, configuration): Promise<FieldLike[]> | FieldLike[]

    - #### Parameters

      - ##### table_id: number | string | undefined

      - ##### viewname: string

      - ##### configuration: any

      #### Returns Promise<FieldLike[]> | FieldLike[]

- ##### `Optional` initial_config?: ((arg0) => Promise<any>)

  - - (arg0): Promise<any>

    - #### Parameters

      - ##### arg0: {
        table_id: number;
        }

        - ##### table_id: number

      #### Returns Promise<any>

- ##### `Optional` interpolate_title_string?: ((table_id, title, query) => Promise<string>)

  - - (table_id, title, query): Promise<string>

    - #### Parameters

      - ##### table_id: number | string | undefined

      - ##### title: string

      - ##### query: any

      #### Returns Promise<string>

- ##### name: string

- ##### `Optional` on_delete?: ((table_id, viewname, configuration) => Promise<void>)

  - - (table_id, viewname, configuration): Promise<void>

    - #### Parameters

      - ##### table_id: number

      - ##### viewname: string

      - ##### configuration: {
        default_state: any;
        }

        - ##### default_state: any

      #### Returns Promise<void>

- ##### `Optional` openDataStream?: ((table_id, viewName, id, fieldName, fieldView, user, configuration, targetOpts) => Promise<any>)

  - - (table_id, viewName, id, fieldName, fieldView, user, configuration, targetOpts): Promise<any>

    - #### Parameters

      - ##### table_id: number | undefined

      - ##### viewName: string

      - ##### id: number | undefined

      - ##### fieldName: string

      - ##### fieldView: string

      - ##### user: any

      - ##### configuration: any

      - ##### targetOpts: any

      #### Returns Promise<any>

- ##### `Optional` queries?: ((configuration?, req?) => Record<string, any>)

  - - (configuration?, req?): Record<string, any>

    - #### Parameters

      - ##### `Optional` configuration: any

      - ##### `Optional` req: any

      #### Returns Record<string, any>

- ##### `Optional` renderRows?: ((table, viewname, { columns, layout }, extra, rows, state) => Promise<string[]>)

  - - (table, viewname, { columns, layout }, extra, rows, state): Promise<string[]>

    - #### Parameters

      - ##### table: AbstractTable

      - ##### viewname: string

      - ##### { columns, layout }: {
        columns: Column[];
        layout: Layout;
        }

        - ##### columns: Column[]

        - ##### layout: Layout

      - ##### extra: any

      - ##### rows: Row[]

      - ##### state: any

      #### Returns Promise<string[]>

- ##### `Optional` routes?: Record<string, RouteAction>

- ##### run: ((table_id, viewname, opts, state, arg4, queries) => Promise<string>)

  - - (table_id, viewname, opts, state, arg4, queries): Promise<string>

    - #### Parameters

      - ##### table_id: string | number | undefined

      - ##### viewname: string

      - ##### opts: any

      - ##### state: any

      - ##### arg4: RunExtra

      - ##### queries: any

      #### Returns Promise<string>

- ##### `Optional` runMany?: ((table_id, viewname, { columns, layout }, state, extra, queries) => Promise<string[]>)

  - - (table_id, viewname, { columns, layout }, state, extra, queries): Promise<string[]>

    - #### Parameters

      - ##### table_id: number

      - ##### viewname: string

      - ##### { columns, layout }: {
        columns: Column[];
        layout: Layout;
        }

        - ##### columns: Column[]

        - ##### layout: Layout

      - ##### state: any

      - ##### extra: RunExtra

      - ##### queries: any

      #### Returns Promise<string[]>

- ##### `Optional` runPost?: ((table_id, viewname, optsOne, state, body, extraArgs, queries, remote?) => Promise<void>)

  - - (table_id, viewname, optsOne, state, body, extraArgs, queries, remote?): Promise<void>

    - #### Parameters

      - ##### table_id: number | number | undefined

      - ##### viewname: string

      - ##### optsOne: {
        columns: any[];
        fixed: any;
        formula_destinations: any;
        layout: Layout;
        view_when_done: any;
        }

        - ##### columns: any[]

        - ##### fixed: any

        - ##### formula_destinations: any

        - ##### layout: Layout

        - ##### view_when_done: any

      - ##### state: GenObj

      - ##### body: GenObj

      - ##### extraArgs: RunExtra

      - ##### queries: any

      - ##### `Optional` remote: boolean

      #### Returns Promise<void>

- ##### `Optional` singleton?: boolean

- ##### `Optional` table_optional?: boolean

- ##### `Optional` tableless?: boolean

- ##### `Optional` view_quantity?: "Many" | "ZeroOrOne" | "One"

- ##### `Optional` virtual_triggers?: ((table_id, name, configuration) => Promise<AbstractTrigger[]>)

  - - (table_id, name, configuration): Promise<AbstractTrigger[]>

    - #### Parameters

      - ##### table_id: number | undefined

      - ##### name: string

      - ##### configuration: any

      #### Returns Promise<AbstractTrigger[]>

- Defined in saltcorn-types/base_types.ts:244

Generated using TypeDoc