# Variable state

state: {
add_tenant: (t: string) => void;
features: {
aggregation_query: boolean;
api_view_route: boolean;
async_validate: boolean;
bootstrap5: boolean;
capacitor: boolean;
capacitor_version: number;
deep_public_plugin_serve: boolean;
dynamic_auth_parameters: boolean;
ellipsize: boolean;
esm_plugins: boolean;
fieldrepeats_in_field_attributes: boolean;
file_fieldviews_cfg_workflows: boolean;
get_view_goto: boolean;
json_state_query: boolean;
list_builder: boolean;
metadata: boolean;
multitype_fieldviews: boolean;
nested_fieldrepeats: boolean;
no_plugin_fieldview_length_check: boolean;
prefix_or_in_queries: boolean;
public_user_role: number;
serve_static_dependencies: boolean;
stringify_json_fields: boolean;
table_undo: boolean;
version_plugin_serve_path: boolean;
workflows: boolean;
};
get_other_domain_tenant: (hostname: string) => string;
get_process_init_time: () => Date;
getAllTenants: () => Record<string, State>;
getApp__: () => (s: string) => string;
getReq__: () => (s: string) => string;
getRootState: () => State;
getState: () => State | undefined;
getTenant: (ten: string) => State;
init_multi_tenant: (
plugin_loader: (s: string) => Promise<void>,
disableMigrate: boolean,
tenantList: string[],
setupMultiNodeListener: Function,
) => Promise<void>;
process_send: (v: any) => void;
restart_tenant: (plugin_loader: Function) => Promise<void>;
set_tenant_base_url: (tenant_subdomain: string, value?: string) => void;
}

#### Type Declaration

- ##### add_tenant: (t: string) => void

  Add tenant to State

- ##### features: {
  aggregation_query: boolean;
  api_view_route: boolean;
  async_validate: boolean;
  bootstrap5: boolean;
  capacitor: boolean;
  capacitor_version: number;
  deep_public_plugin_serve: boolean;
  dynamic_auth_parameters: boolean;
  ellipsize: boolean;
  esm_plugins: boolean;
  fieldrepeats_in_field_attributes: boolean;
  file_fieldviews_cfg_workflows: boolean;
  get_view_goto: boolean;
  json_state_query: boolean;
  list_builder: boolean;
  metadata: boolean;
  multitype_fieldviews: boolean;
  nested_fieldrepeats: boolean;
  no_plugin_fieldview_length_check: boolean;
  prefix_or_in_queries: boolean;
  public_user_role: number;
  serve_static_dependencies: boolean;
  stringify_json_fields: boolean;
  table_undo: boolean;
  version_plugin_serve_path: boolean;
  workflows: boolean;
  }

  State Features - Help modules figure out what features are available in core saltcorn. This is necessary because modules need to work on different versions of core saltcorn

- ##### get_other_domain_tenant: (hostname: string) => string

  Get tenant that has another domain (not subdomain)

- ##### get_process_init_time: () => Date

  Get Process Init Time - moment when Saltcorn process was initiated

- ##### getAllTenants: () => Record<string, State>

  Returns all Tenants (from State)

- ##### getApp__: () => (s: string) => string

- ##### getReq__: () => (s: string) => string

- ##### getRootState: () => State

- ##### `Function` getState: () => State | undefined

  Get the state in the current tenant

- ##### getTenant: (ten: string) => State

  Get tenant from State

- ##### init_multi_tenant: (
  plugin_loader: (s: string) => Promise<void>,
  disableMigrate: boolean,
  tenantList: string[],
  setupMultiNodeListener: Function,
  ) => Promise<void>

  Switch to multi_tenant

- ##### process_send: (v: any) => void

- ##### restart_tenant: (plugin_loader: Function) => Promise<void>

  Restart tenant (means reload of plugins)

- ##### set_tenant_base_url: (tenant_subdomain: string, value?: string) => void

  Set tenant base url??? From my point of view it just add tenant to list of otherdomaintenant

- Defined in packages/saltcorn-data/db/state.ts:1773