# Variable fileviews`Const`

fileviews: {
Audio: {
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
Capture: {
configFields: () => Promise<
(
| {
attributes: { options: string[] };
default?: undefined;
label: string;
name: string;
required?: undefined;
showIf?: undefined;
type: string;
}
| {
attributes: { options: string[] };
default?: undefined;
label: string;
name: string;
required: boolean;
showIf?: undefined;
type: string;
}
| {
attributes: { options: { label: string; name: string }[] };
default: string;
label: string;
name: string;
required?: undefined;
showIf?: undefined;
type: string;
}
| {
attributes?: undefined;
default?: undefined;
label: string;
name: string;
required?: undefined;
showIf: { button_style: string[] };
type: string;
}
)[],
>;
description: string;
isEdit: boolean;
multipartFormData: boolean;
run: (
nm: string,
file_name: string,
attrs: GenObj,
cls: string,
reqd: boolean,
field: GenObj,
) => any;
valueIsFilename: boolean;
};
"Download link": {
configFields: {
attributes: { options: { label: string; name: string }[] };
label: string;
name: string;
required: boolean;
type: string;
}[];
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
Link: {
configFields: {
attributes: { options: { label: string; name: string }[] };
label: string;
name: string;
required: boolean;
type: string;
}[];
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
"Link (new tab)": {
configFields: {
attributes: { options: { label: string; name: string }[] };
label: string;
name: string;
required: boolean;
type: string;
}[];
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
select: {
configFields: () => Promise<
(
| {
attributes: { options: string[] };
default?: undefined;
label: string;
name: string;
showIf?: undefined;
subfolder?: undefined;
sublabel?: undefined;
type: string;
}
| {
attributes?: undefined;
default: boolean;
label: string;
name: string;
showIf?: undefined;
subfolder?: undefined;
sublabel: string;
type: string;
}
| {
attributes?: undefined;
default: boolean;
label: string;
name: string;
showIf: { use_picker: boolean };
subfolder?: undefined;
sublabel: string;
type: string;
}
| {
attributes?: undefined;
default?: undefined;
label: string;
name: string;
showIf?: undefined;
subfolder: string;
sublabel?: undefined;
type: string;
}
)[],
>;
description: string;
fill_options: (field: GenObj) => Promise<void>;
isEdit: boolean;
run: (
nm: string,
file_id: string,
attrs: GenObj,
cls: string,
reqd: boolean,
field: GenObj,
) => any;
setsFileId: boolean;
};
"Show Image": {
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
TextEditor: {
configFields: () => Promise<
{
attributes: { options: string[] };
label: string;
name: string;
required: boolean;
type: string;
}[],
>;
description: string;
editContent: boolean;
isEdit: boolean;
multipartFormData: boolean;
run: (
nm: string,
file_name: string,
attrs: GenObj,
cls: string,
reqd: boolean,
field: GenObj,
row?: GenObj,
) => any;
};
Thumbnail: {
configFields: () => (
| { label: string; name: string; required: boolean; type: string }
| { label: string; name: string; required?: undefined; type: string }
)[];
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
upload: {
configFields: () => Promise<
(
| {
attributes: { options: string[] };
default?: undefined;
label: string;
name: string;
required?: undefined;
showIf?: undefined;
type: string;
}
| {
attributes: { options: { label: string; name: string }[] };
default: string;
label: string;
name: string;
required: boolean;
showIf?: undefined;
type: string;
}
| {
attributes?: undefined;
default?: undefined;
label: string;
name: string;
required?: undefined;
showIf: { button_style: string[] };
type: string;
}
)[],
>;
description: string;
isEdit: boolean;
multipartFormData: boolean;
run: (
nm: string,
file_name: string,
attrs: GenObj,
cls: string,
reqd: boolean,
field: GenObj,
) => string;
valueIsFilename: boolean;
};
Video: {
configFields: { label: string; name: string; type: string }[];
description: string;
run: (filePath: string, file_name: string, cfg?: GenObj) => any;
};
} = ...

#### Type Declaration

- ##### Audio: {
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- ##### Capture: {
  configFields: () => Promise<
  (
  | {
  attributes: { options: string[] };
  default?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf?: undefined;
  type: string;
  }
  | {
  attributes: { options: string[] };
  default?: undefined;
  label: string;
  name: string;
  required: boolean;
  showIf?: undefined;
  type: string;
  }
  | {
  attributes: { options: { label: string; name: string }[] };
  default: string;
  label: string;
  name: string;
  required?: undefined;
  showIf?: undefined;
  type: string;
  }
  | {
  attributes?: undefined;
  default?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { button_style: string[] };
  type: string;
  }
  )[],
  >;
  description: string;
  isEdit: boolean;
  multipartFormData: boolean;
  run: (
  nm: string,
  file_name: string,
  attrs: GenObj,
  cls: string,
  reqd: boolean,
  field: GenObj,
  ) => any;
  valueIsFilename: boolean;
  }

- ##### Download link: {
  configFields: {
  attributes: { options: { label: string; name: string }[] };
  label: string;
  name: string;
  required: boolean;
  type: string;
  }[];
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- ##### Link: {
  configFields: {
  attributes: { options: { label: string; name: string }[] };
  label: string;
  name: string;
  required: boolean;
  type: string;
  }[];
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- ##### Link (new tab): {
  configFields: {
  attributes: { options: { label: string; name: string }[] };
  label: string;
  name: string;
  required: boolean;
  type: string;
  }[];
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- ##### select: {
  configFields: () => Promise<
  (
  | {
  attributes: { options: string[] };
  default?: undefined;
  label: string;
  name: string;
  showIf?: undefined;
  subfolder?: undefined;
  sublabel?: undefined;
  type: string;
  }
  | {
  attributes?: undefined;
  default: boolean;
  label: string;
  name: string;
  showIf?: undefined;
  subfolder?: undefined;
  sublabel: string;
  type: string;
  }
  | {
  attributes?: undefined;
  default: boolean;
  label: string;
  name: string;
  showIf: { use_picker: boolean };
  subfolder?: undefined;
  sublabel: string;
  type: string;
  }
  | {
  attributes?: undefined;
  default?: undefined;
  label: string;
  name: string;
  showIf?: undefined;
  subfolder: string;
  sublabel?: undefined;
  type: string;
  }
  )[],
  >;
  description: string;
  fill_options: (field: GenObj) => Promise<void>;
  isEdit: boolean;
  run: (
  nm: string,
  file_id: string,
  attrs: GenObj,
  cls: string,
  reqd: boolean,
  field: GenObj,
  ) => any;
  setsFileId: boolean;
  }

- ##### Show Image: {
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- ##### TextEditor: {
  configFields: () => Promise<
  {
  attributes: { options: string[] };
  label: string;
  name: string;
  required: boolean;
  type: string;
  }[],
  >;
  description: string;
  editContent: boolean;
  isEdit: boolean;
  multipartFormData: boolean;
  run: (
  nm: string,
  file_name: string,
  attrs: GenObj,
  cls: string,
  reqd: boolean,
  field: GenObj,
  row?: GenObj,
  ) => any;
  }

- ##### Thumbnail: {
  configFields: () => (
  | { label: string; name: string; required: boolean; type: string }
  | { label: string; name: string; required?: undefined; type: string }
  )[];
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- ##### upload: {
  configFields: () => Promise<
  (
  | {
  attributes: { options: string[] };
  default?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf?: undefined;
  type: string;
  }
  | {
  attributes: { options: { label: string; name: string }[] };
  default: string;
  label: string;
  name: string;
  required: boolean;
  showIf?: undefined;
  type: string;
  }
  | {
  attributes?: undefined;
  default?: undefined;
  label: string;
  name: string;
  required?: undefined;
  showIf: { button_style: string[] };
  type: string;
  }
  )[],
  >;
  description: string;
  isEdit: boolean;
  multipartFormData: boolean;
  run: (
  nm: string,
  file_name: string,
  attrs: GenObj,
  cls: string,
  reqd: boolean,
  field: GenObj,
  ) => string;
  valueIsFilename: boolean;
  }

- ##### Video: {
  configFields: { label: string; name: string; type: string }[];
  description: string;
  run: (filePath: string, file_name: string, cfg?: GenObj) => any;
  }

- Defined in saltcorn-data/base-plugin/fileviews.ts:104