# Variable edit

edit: {
authorise_get: (
opts: { query: object; rest: any },
__namedParameters: { authorizeGetQuery: any },
) => Promise<boolean>;
authorise_post: (
opts: { body: object; req: object; table_id: string },
__namedParameters: { authorizePostQuery: any },
) => Promise<boolean>;
authorizeDataStream: (
view: any,
id: any,
fieldName: any,
user: any,
targetOpts: any,
) => Promise<boolean>;
configCheck: (
view: any,
) => Promise<{ errors: string[]; warnings: string[] }>;
configuration_workflow: (req: object) => Workflow;
connectedObjects: (configuration: any) => Promise<ConnectedObjects>;
createBasicView: (
__namedParameters: {
all_views_created: any;
table: any;
template_table: any;
template_view: any;
viewname: any;
},
) => Promise<any>;
description: string;
get_state_fields: (
table_id: any,
viewname: any,
opts: { columns: any },
) => Promise<object[]>;
initial_config: Function;
name: string;
openDataStream: (
tableId: any,
viewName: any,
id: any,
fieldName: any,
fieldView: any,
user: any,
configuration: any,
targetOpts: any,
) => Promise<any>;
queries: (
__namedParameters: {
configuration: {
auto_create: any;
auto_save: any;
columns: any;
confirm_leave: any;
default_state: any;
delete_unchanged_auto_create: any;
destination_type: any;
enable_realtime: any;
fixed: any;
layout: any;
split_paste: any;
update_events: any;
};
name: any;
req: any;
res: any;
table_id: any;
},
) => {
actionQuery(): Promise<any>;
authorizeGetQuery(
query: any,
table_id: any,
): Promise<string | number | boolean | null | undefined>;
authorizePostQuery(body: any, table_id: any): Promise<boolean | "" | null>;
editManyQuery(
state: any,
__namedParameters: {
limit: any;
offset: any;
orderBy: any;
orderDesc: any;
where: any;
},
): Promise<{ fields: Field[]; rows: Row[]; table: Table | null }>;
editQuery(
state: any,
mobileReferrer: any,
isPreview: any,
hiddenLoginDest: any,
): Promise<Form>;
getRowByIdQuery(id: any): Promise<Row | null>;
getRowQuery(
table_id: any,
view_select: any,
row_id: any,
order_field: any,
): Promise<Row[]>;
optionsQuery(
reftable_name: any,
type: any,
attributes: any,
where: any,
): Promise<Row[]>;
saveFileFromContentsQuery(
fieldVal: any,
fieldId: any,
fieldView: any,
row: any,
filename: any,
encoding?: string,
): Promise<string>;
saveFileQuery(
fieldVal: any,
fieldId: any,
fieldView: any,
row: any,
): Promise<string>;
tryInsertQuery(
row: any,
): Promise<{ error: string } | { success: PrimaryKeyValue }>;
tryUpdateQuery(row: any, id: any): Promise<any>;
updateMatchingQuery(
where: any,
updateVals: any,
repeatFields: any,
childRows: any,
): Promise<
| any[]
| { error?: undefined; inEditError?: undefined; rowError: any }
| { error?: undefined; inEditError: any; rowError?: undefined }
| { error: any; inEditError?: undefined; rowError?: undefined },
>;
};
routes: {
run_action: (
table_id: number,
viewname: any,
opts: { columns: object[]; layout: any },
body: any,
optsTwo: { req: object; res: any },
__namedParameters: { actionQuery: any },
) => Promise<object>;
update_matching_rows: (
table_id: any,
viewname: any,
__namedParameters: {
auto_save: any;
columns: any;
dest_url_formula: any;
destination_type: any;
fixed: any;
formula_destinations: any;
layout: any;
page_group_when_done: any;
page_when_done: any;
view_when_done: any;
},
body: any,
__namedParameters: { redirect: any; req: any; res: any },
__namedParameters: {
getRowByIdQuery: any;
getRowQuery: any;
optionsQuery: any;
saveFileFromContentsQuery: any;
saveFileQuery: any;
updateMatchingQuery: any;
},
) => Promise<void>;
};
run: (
table_id: number,
viewname: string,
cfg: any,
state: string,
optsOne: { req: object; res: object },
optsTwo: { editQuery: any },
) => Promise<Form>;
runMany: (
table_id: number,
viewname: string,
opts: { columns: any; layout: any },
state: State,
extra: object,
__namedParameters: {
editManyQuery: any;
getRowQuery: any;
optionsQuery: any;
},
) => Promise<Form[]>;
runPost: (
table_id: number,
viewname: string,
optsOne: {
columns: object[];
fixed: object;
formula_destinations: object[];
layout: Layout;
view_when_done: boolean;
},
state: object,
body: any,
optsTwo: { redirect: string; req: object; res: object },
__namedParameters: {
getRowByIdQuery: any;
getRowQuery: any;
optionsQuery: any;
saveFileFromContentsQuery: any;
saveFileQuery: any;
tryInsertQuery: any;
tryUpdateQuery: any;
},
remote: any,
) => Promise<void>;
virtual_triggers: (
table_id: any,
viewname: any,
__namedParameters: { enable_realtime: any; update_events: any },
) => {
run: (
row: any,
__namedParameters: { old_row: any; user: any },
) => Promise<void>;
table_id: any;
when_trigger: string;
}[];
getStringsForI18n(opts: { layout: Layout }): string[];
interpolate_title_string(
table_id: any,
title: any,
state: any,
): Promise<string>;
}

#### Type Declaration

- ##### authorise_get: (
  opts: { query: object; rest: any },
  __namedParameters: { authorizeGetQuery: any },
  ) => Promise<boolean>

- ##### authorise_post: (
  opts: { body: object; req: object; table_id: string },
  __namedParameters: { authorizePostQuery: any },
  ) => Promise<boolean>

- ##### authorizeDataStream: (
  view: any,
  id: any,
  fieldName: any,
  user: any,
  targetOpts: any,
  ) => Promise<boolean>

- ##### configCheck: (view: any) => Promise<{ errors: string[]; warnings: string[] }>

- ##### configuration_workflow: (req: object) => Workflow

- ##### connectedObjects: (configuration: any) => Promise<ConnectedObjects>

- ##### createBasicView: (
  __namedParameters: {
  all_views_created: any;
  table: any;
  template_table: any;
  template_view: any;
  viewname: any;
  },
  ) => Promise<any>

- ##### description: string

- ##### get_state_fields: (table_id: any, viewname: any, opts: { columns: any }) => Promise<object[]>

- ##### initial_config: Function

- ##### name: string

- ##### openDataStream: (
  tableId: any,
  viewName: any,
  id: any,
  fieldName: any,
  fieldView: any,
  user: any,
  configuration: any,
  targetOpts: any,
  ) => Promise<any>

- ##### queries: (
  __namedParameters: {
  configuration: {
  auto_create: any;
  auto_save: any;
  columns: any;
  confirm_leave: any;
  default_state: any;
  delete_unchanged_auto_create: any;
  destination_type: any;
  enable_realtime: any;
  fixed: any;
  layout: any;
  split_paste: any;
  update_events: any;
  };
  name: any;
  req: any;
  res: any;
  table_id: any;
  },
  ) => {
  actionQuery(): Promise<any>;
  authorizeGetQuery(
  query: any,
  table_id: any,
  ): Promise<string | number | boolean | null | undefined>;
  authorizePostQuery(body: any, table_id: any): Promise<boolean | "" | null>;
  editManyQuery(
  state: any,
  __namedParameters: {
  limit: any;
  offset: any;
  orderBy: any;
  orderDesc: any;
  where: any;
  },
  ): Promise<{ fields: Field[]; rows: Row[]; table: Table | null }>;
  editQuery(
  state: any,
  mobileReferrer: any,
  isPreview: any,
  hiddenLoginDest: any,
  ): Promise<Form>;
  getRowByIdQuery(id: any): Promise<Row | null>;
  getRowQuery(
  table_id: any,
  view_select: any,
  row_id: any,
  order_field: any,
  ): Promise<Row[]>;
  optionsQuery(
  reftable_name: any,
  type: any,
  attributes: any,
  where: any,
  ): Promise<Row[]>;
  saveFileFromContentsQuery(
  fieldVal: any,
  fieldId: any,
  fieldView: any,
  row: any,
  filename: any,
  encoding?: string,
  ): Promise<string>;
  saveFileQuery(
  fieldVal: any,
  fieldId: any,
  fieldView: any,
  row: any,
  ): Promise<string>;
  tryInsertQuery(
  row: any,
  ): Promise<{ error: string } | { success: PrimaryKeyValue }>;
  tryUpdateQuery(row: any, id: any): Promise<any>;
  updateMatchingQuery(
  where: any,
  updateVals: any,
  repeatFields: any,
  childRows: any,
  ): Promise<
  | any[]
  | { error?: undefined; inEditError?: undefined; rowError: any }
  | { error?: undefined; inEditError: any; rowError?: undefined }
  | { error: any; inEditError?: undefined; rowError?: undefined },
  >;
  }

- ##### routes: {
  run_action: (
  table_id: number,
  viewname: any,
  opts: { columns: object[]; layout: any },
  body: any,
  optsTwo: { req: object; res: any },
  __namedParameters: { actionQuery: any },
  ) => Promise<object>;
  update_matching_rows: (
  table_id: any,
  viewname: any,
  __namedParameters: {
  auto_save: any;
  columns: any;
  dest_url_formula: any;
  destination_type: any;
  fixed: any;
  formula_destinations: any;
  layout: any;
  page_group_when_done: any;
  page_when_done: any;
  view_when_done: any;
  },
  body: any,
  __namedParameters: { redirect: any; req: any; res: any },
  __namedParameters: {
  getRowByIdQuery: any;
  getRowQuery: any;
  optionsQuery: any;
  saveFileFromContentsQuery: any;
  saveFileQuery: any;
  updateMatchingQuery: any;
  },
  ) => Promise<void>;
  }

  - ##### run_action: (
    table_id: number,
    viewname: any,
    opts: { columns: object[]; layout: any },
    body: any,
    optsTwo: { req: object; res: any },
    __namedParameters: { actionQuery: any },
    ) => Promise<object>

  - ##### update_matching_rows: (
    table_id: any,
    viewname: any,
    __namedParameters: {
    auto_save: any;
    columns: any;
    dest_url_formula: any;
    destination_type: any;
    fixed: any;
    formula_destinations: any;
    layout: any;
    page_group_when_done: any;
    page_when_done: any;
    view_when_done: any;
    },
    body: any,
    __namedParameters: { redirect: any; req: any; res: any },
    __namedParameters: {
    getRowByIdQuery: any;
    getRowQuery: any;
    optionsQuery: any;
    saveFileFromContentsQuery: any;
    saveFileQuery: any;
    updateMatchingQuery: any;
    },
    ) => Promise<void>

- ##### run: (
  table_id: number,
  viewname: string,
  cfg: any,
  state: string,
  optsOne: { req: object; res: object },
  optsTwo: { editQuery: any },
  ) => Promise<Form>

- ##### runMany: (
  table_id: number,
  viewname: string,
  opts: { columns: any; layout: any },
  state: State,
  extra: object,
  __namedParameters: {
  editManyQuery: any;
  getRowQuery: any;
  optionsQuery: any;
  },
  ) => Promise<Form[]>

- ##### runPost: (
  table_id: number,
  viewname: string,
  optsOne: {
  columns: object[];
  fixed: object;
  formula_destinations: object[];
  layout: Layout;
  view_when_done: boolean;
  },
  state: object,
  body: any,
  optsTwo: { redirect: string; req: object; res: object },
  __namedParameters: {
  getRowByIdQuery: any;
  getRowQuery: any;
  optionsQuery: any;
  saveFileFromContentsQuery: any;
  saveFileQuery: any;
  tryInsertQuery: any;
  tryUpdateQuery: any;
  },
  remote: any,
  ) => Promise<void>

- ##### virtual_triggers: (
  table_id: any,
  viewname: any,
  __namedParameters: { enable_realtime: any; update_events: any },
  ) => {
  run: (
  row: any,
  __namedParameters: { old_row: any; user: any },
  ) => Promise<void>;
  table_id: any;
  when_trigger: string;
  }[]

- ##### getStringsForI18n: function

  - getStringsForI18n(opts: { layout: Layout }): string[]

    #### Parameters

    - opts: { layout: Layout }

    #### Returns string[]

    - Defined in packages/saltcorn-data/base-plugin/viewtemplates/edit.js:2149

- ##### interpolate_title_string: function

  - interpolate_title_string(table_id: any, title: any, state: any): Promise<string>

    #### Parameters

    - table_id: any
    - title: any
    - state: any

    #### Returns Promise<string>

    - Defined in packages/saltcorn-data/base-plugin/viewtemplates/edit.js:2604

- Defined in packages/saltcorn-data/base-plugin/viewtemplates/edit.js:2119