# Variable: file

```ts
const file: object & Typed<{
  alt?: string;
  blob?: {
     hash: string;
     key?: string;
     mime: string;
     name?: string;
     salt?: string;
     size: number;
  };
  captions?: {
     hash: string;
     key?: string;
     mime: string;
     name?: string;
     salt?: string;
     size: number;
  };
  duration?: number;
  height?: number;
  mime: string;
  name: string;
  place?: {
     address?: {
        country?: string;
        locality?: string;
        postcode?: string;
        region?: string;
        street?: string;
     };
     cells?: readonly string[];
     lat?: number;
     lon?: number;
     name?: string;
  };
  size?: number;
  takenAt?: string;
  thumbnail?: {
     hash: string;
     key?: string;
     mime: string;
     name?: string;
     salt?: string;
     size: number;
  };
  url?: string;
  width?: number;
}>;
```

Defined in: [packages/core/src/schemas/library/media.ts:72](https://github.com/leifriksheim/minca/blob/main/core/src/schemas/library/media.ts#L72)

A file kept in the space, or one kept elsewhere at `url`: the one record for
every file, whatever app shares it. A photo, a video or a song's audio is a
file with the fields that suit it. `about` is the record it was shared on or
attached to, like a message or a task; a file shared on its own has none.
Groups of files (folders, albums, categories) are `std.list`s with an item
about each file, so one file can be in many.

## Type Declaration

### description

```ts
readonly description: "Any file people share: a document, photo, video or recording, on its own or attached to a record (about). The only collection for files: a photo or video is a std.file too. For a folder, album or category of files, use std.list with a std.list-item about each file." = 'Any file people share: a document, photo, video or recording, on its own or attached to a record (about). The only collection for files: a photo or video is a std.file too. For a folder, album or category of files, use std.list with a std.list-item about each file.';
```

### links

```ts
readonly links: object;
```

#### links.about

```ts
readonly about: LinkDeclaration;
```

### name

```ts
readonly name: "std.file" = 'std.file';
```

### schema

```ts
readonly schema: object;
```

#### schema.properties

```ts
readonly properties: object;
```

#### schema.properties.alt

```ts
readonly alt: object;
```

#### schema.properties.alt.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.alt.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.alt.type

```ts
type: "string";
```

#### schema.properties.blob

```ts
readonly blob: object & object;
```

##### Type Declaration

###### properties

```ts
properties: object;
```

###### properties.hash

```ts
hash: object;
```

###### properties.hash.maxLength

```ts
maxLength: number = 64;
```

###### properties.hash.minLength

```ts
minLength: number = 64;
```

###### properties.hash.type

```ts
type: "string";
```

###### properties.key

```ts
key: object;
```

###### properties.key.maxLength

```ts
maxLength: number = 22;
```

###### properties.key.minLength

```ts
minLength: number = 22;
```

###### properties.key.type

```ts
type: "string";
```

###### properties.mime

```ts
mime: object;
```

###### properties.mime.maxLength

```ts
maxLength: number = max;
```

###### properties.mime.minLength?

```ts
minLength?: number = min;
```

###### properties.mime.type

```ts
type: "string";
```

###### properties.name

```ts
name: object;
```

###### properties.name.maxLength

```ts
maxLength: number = max;
```

###### properties.name.minLength?

```ts
minLength?: number = min;
```

###### properties.name.type

```ts
type: "string";
```

###### properties.salt

```ts
salt: object;
```

###### properties.salt.maxLength

```ts
maxLength: number = 22;
```

###### properties.salt.minLength

```ts
minLength: number = 22;
```

###### properties.salt.type

```ts
type: "string";
```

###### properties.size

```ts
size: object;
```

###### properties.size.minimum

```ts
minimum: number = 0;
```

###### properties.size.type

```ts
type: "integer";
```

###### required

```ts
required: readonly ["hash", "size", "mime"];
```

###### type

```ts
type: "object";
```

###### x-kind

```ts
readonly "x-kind": "file";
```

#### schema.properties.captions

```ts
readonly captions: object & object;
```

##### Type Declaration

###### properties

```ts
properties: object;
```

###### properties.hash

```ts
hash: object;
```

###### properties.hash.maxLength

```ts
maxLength: number = 64;
```

###### properties.hash.minLength

```ts
minLength: number = 64;
```

###### properties.hash.type

```ts
type: "string";
```

###### properties.key

```ts
key: object;
```

###### properties.key.maxLength

```ts
maxLength: number = 22;
```

###### properties.key.minLength

```ts
minLength: number = 22;
```

###### properties.key.type

```ts
type: "string";
```

###### properties.mime

```ts
mime: object;
```

###### properties.mime.maxLength

```ts
maxLength: number = max;
```

###### properties.mime.minLength?

```ts
minLength?: number = min;
```

###### properties.mime.type

```ts
type: "string";
```

###### properties.name

```ts
name: object;
```

###### properties.name.maxLength

```ts
maxLength: number = max;
```

###### properties.name.minLength?

```ts
minLength?: number = min;
```

###### properties.name.type

```ts
type: "string";
```

###### properties.salt

```ts
salt: object;
```

###### properties.salt.maxLength

```ts
maxLength: number = 22;
```

###### properties.salt.minLength

```ts
minLength: number = 22;
```

###### properties.salt.type

```ts
type: "string";
```

###### properties.size

```ts
size: object;
```

###### properties.size.minimum

```ts
minimum: number = 0;
```

###### properties.size.type

```ts
type: "integer";
```

###### required

```ts
required: readonly ["hash", "size", "mime"];
```

###### type

```ts
type: "object";
```

###### x-kind

```ts
readonly "x-kind": "file";
```

#### schema.properties.duration

```ts
readonly duration: object;
```

#### schema.properties.duration.description

```ts
readonly description: "Seconds, for a video or a sound" = 'Seconds, for a video or a sound';
```

#### schema.properties.duration.minimum

```ts
readonly minimum: 0 = 0;
```

#### schema.properties.duration.type

```ts
readonly type: "number" = 'number';
```

#### schema.properties.height

```ts
readonly height: object;
```

#### schema.properties.height.maximum?

```ts
maximum?: number = max;
```

#### schema.properties.height.minimum

```ts
minimum: number = min;
```

#### schema.properties.height.type

```ts
type: "integer";
```

#### schema.properties.mime

```ts
readonly mime: object;
```

#### schema.properties.mime.maxLength

```ts
readonly maxLength: 255 = 255;
```

#### schema.properties.mime.minLength

```ts
readonly minLength: 1 = 1;
```

#### schema.properties.mime.type

```ts
readonly type: "string" = 'string';
```

#### schema.properties.name

```ts
readonly name: object;
```

#### schema.properties.name.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.name.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.name.type

```ts
type: "string";
```

#### schema.properties.place

```ts
readonly place: object;
```

#### schema.properties.place.properties

```ts
properties: object;
```

#### schema.properties.place.properties.address

```ts
address: object;
```

#### schema.properties.place.properties.address.properties

```ts
properties: object;
```

#### schema.properties.place.properties.address.properties.country

```ts
country: object;
```

#### schema.properties.place.properties.address.properties.country.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.address.properties.country.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.address.properties.country.type

```ts
type: "string";
```

#### schema.properties.place.properties.address.properties.locality

```ts
locality: object;
```

#### schema.properties.place.properties.address.properties.locality.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.address.properties.locality.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.address.properties.locality.type

```ts
type: "string";
```

#### schema.properties.place.properties.address.properties.postcode

```ts
postcode: object;
```

#### schema.properties.place.properties.address.properties.postcode.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.address.properties.postcode.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.address.properties.postcode.type

```ts
type: "string";
```

#### schema.properties.place.properties.address.properties.region

```ts
region: object;
```

#### schema.properties.place.properties.address.properties.region.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.address.properties.region.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.address.properties.region.type

```ts
type: "string";
```

#### schema.properties.place.properties.address.properties.street

```ts
street: object;
```

#### schema.properties.place.properties.address.properties.street.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.address.properties.street.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.address.properties.street.type

```ts
type: "string";
```

#### schema.properties.place.properties.address.type

```ts
type: "object";
```

#### schema.properties.place.properties.cells

```ts
cells: object;
```

#### schema.properties.place.properties.cells.description

```ts
description: string = 'The geohash cells lat and lon are in, coarsest first: precisions 3, 4, 5 and 6';
```

#### schema.properties.place.properties.cells.items

```ts
items: object;
```

#### schema.properties.place.properties.cells.items.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.cells.items.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.cells.items.type

```ts
type: "string";
```

#### schema.properties.place.properties.cells.maxItems

```ts
maxItems: number = 8;
```

#### schema.properties.place.properties.cells.type

```ts
type: "array";
```

#### schema.properties.place.properties.lat

```ts
lat: object;
```

#### schema.properties.place.properties.lat.maximum

```ts
maximum: number = 90;
```

#### schema.properties.place.properties.lat.minimum

```ts
minimum: number = -90;
```

#### schema.properties.place.properties.lat.type

```ts
type: "number";
```

#### schema.properties.place.properties.lon

```ts
lon: object;
```

#### schema.properties.place.properties.lon.maximum

```ts
maximum: number = 180;
```

#### schema.properties.place.properties.lon.minimum

```ts
minimum: number = -180;
```

#### schema.properties.place.properties.lon.type

```ts
type: "number";
```

#### schema.properties.place.properties.name

```ts
name: object;
```

#### schema.properties.place.properties.name.maxLength

```ts
maxLength: number = max;
```

#### schema.properties.place.properties.name.minLength?

```ts
minLength?: number = min;
```

#### schema.properties.place.properties.name.type

```ts
type: "string";
```

#### schema.properties.place.type

```ts
type: "object";
```

#### schema.properties.size

```ts
readonly size: object;
```

#### schema.properties.size.maximum?

```ts
maximum?: number = max;
```

#### schema.properties.size.minimum

```ts
minimum: number = min;
```

#### schema.properties.size.type

```ts
type: "integer";
```

#### schema.properties.takenAt

```ts
readonly takenAt: object & object;
```

##### Type Declaration

###### maxLength

```ts
maxLength: number = max;
```

###### minLength?

```ts
minLength?: number = min;
```

###### type

```ts
type: "string";
```

###### x-kind

```ts
readonly "x-kind": "when";
```

#### schema.properties.thumbnail

```ts
readonly thumbnail: object & object;
```

##### Type Declaration

###### properties

```ts
properties: object;
```

###### properties.hash

```ts
hash: object;
```

###### properties.hash.maxLength

```ts
maxLength: number = 64;
```

###### properties.hash.minLength

```ts
minLength: number = 64;
```

###### properties.hash.type

```ts
type: "string";
```

###### properties.key

```ts
key: object;
```

###### properties.key.maxLength

```ts
maxLength: number = 22;
```

###### properties.key.minLength

```ts
minLength: number = 22;
```

###### properties.key.type

```ts
type: "string";
```

###### properties.mime

```ts
mime: object;
```

###### properties.mime.maxLength

```ts
maxLength: number = max;
```

###### properties.mime.minLength?

```ts
minLength?: number = min;
```

###### properties.mime.type

```ts
type: "string";
```

###### properties.name

```ts
name: object;
```

###### properties.name.maxLength

```ts
maxLength: number = max;
```

###### properties.name.minLength?

```ts
minLength?: number = min;
```

###### properties.name.type

```ts
type: "string";
```

###### properties.salt

```ts
salt: object;
```

###### properties.salt.maxLength

```ts
maxLength: number = 22;
```

###### properties.salt.minLength

```ts
minLength: number = 22;
```

###### properties.salt.type

```ts
type: "string";
```

###### properties.size

```ts
size: object;
```

###### properties.size.minimum

```ts
minimum: number = 0;
```

###### properties.size.type

```ts
type: "integer";
```

###### required

```ts
required: readonly ["hash", "size", "mime"];
```

###### type

```ts
type: "object";
```

###### x-kind

```ts
readonly "x-kind": "file";
```

#### schema.properties.url

```ts
readonly url: object & object;
```

##### Type Declaration

###### maxLength

```ts
maxLength: number = max;
```

###### minLength?

```ts
minLength?: number = min;
```

###### type

```ts
type: "string";
```

###### x-kind

```ts
readonly "x-kind": "url";
```

#### schema.properties.width

```ts
readonly width: object;
```

#### schema.properties.width.maximum?

```ts
maximum?: number = max;
```

#### schema.properties.width.minimum

```ts
minimum: number = min;
```

#### schema.properties.width.type

```ts
type: "integer";
```

#### schema.required

```ts
readonly required: readonly ["name", "mime"];
```

#### schema.type

```ts
readonly type: "object" = 'object';
```

### title

```ts
readonly title: "File" = 'File';
```
