Parent class encompassing all Schema types, with static methods that allow building specific Schema types. This class can be converted with `JSON.stringify()` into a JSON string accepted by Agent Platform Gemini API and Gemini Developer API REST endpoints. (This string conversion is automatically done when calling SDK methods.)

**Signature:**

    export declare abstract class Schema implements SchemaInterface 

**Implements:** [SchemaInterface](https://firebase.google.com/docs/reference/js/ai.schemainterface#schemainterface_interface)

## Constructors

| Constructor | Modifiers | Description |
|---|---|---|
| [(constructor)(schemaParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemaconstructor) |   | Constructs a new instance of the `Schema` class |

## Properties

| Property | Modifiers | Type | Description |
|---|---|---|---|
| [description](https://firebase.google.com/docs/reference/js/ai.schema#schemadescription) |   | string | Optional. The description of the property. |
| [example](https://firebase.google.com/docs/reference/js/ai.schema#schemaexample) |   | unknown | Optional. The example of the property. |
| [format](https://firebase.google.com/docs/reference/js/ai.schema#schemaformat) |   | string | Optional. The format of the property. Supported formats: - for NUMBER type: "float", "double" - for INTEGER type: "int32", "int64" - for STRING type: "email", "byte", etc |
| [items](https://firebase.google.com/docs/reference/js/ai.schema#schemaitems) |   | [SchemaInterface](https://firebase.google.com/docs/reference/js/ai.schemainterface#schemainterface_interface) | Optional. The items of the property. |
| [maxItems](https://firebase.google.com/docs/reference/js/ai.schema#schemamaxitems) |   | number | The maximum number of items (elements) in a schema of [SchemaType](https://firebase.google.com/docs/reference/js/ai#schematype) `array`. |
| [minItems](https://firebase.google.com/docs/reference/js/ai.schema#schemaminitems) |   | number | The minimum number of items (elements) in a schema of [SchemaType](https://firebase.google.com/docs/reference/js/ai#schematype) `array`. |
| [nullable](https://firebase.google.com/docs/reference/js/ai.schema#schemanullable) |   | boolean | Optional. Whether the property is nullable. Defaults to false. |
| [type](https://firebase.google.com/docs/reference/js/ai.schema#schematype) |   | [SchemaType](https://firebase.google.com/docs/reference/js/ai#schematype) | Optional. The type of the property. This can only be undefined when using `anyOf` schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type). |

## Methods

| Method | Modifiers | Description |
|---|---|---|
| [anyOf(anyOfParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemaanyof) | `static` |   |
| [array(arrayParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemaarray) | `static` |   |
| [boolean(booleanParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemaboolean) | `static` |   |
| [enumString(stringParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemaenumstring) | `static` |   |
| [integer(integerParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemainteger) | `static` |   |
| [number(numberParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemanumber) | `static` |   |
| [object(objectParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemaobject) | `static` |   |
| [string(stringParams)](https://firebase.google.com/docs/reference/js/ai.schema#schemastring) | `static` |   |

## Schema.(constructor)

Constructs a new instance of the `Schema` class

**Signature:**

    constructor(schemaParams: SchemaInterface);

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| schemaParams | [SchemaInterface](https://firebase.google.com/docs/reference/js/ai.schemainterface#schemainterface_interface) |   |

## Schema.description

Optional. The description of the property.

**Signature:**

    description?: string;

## Schema.example

Optional. The example of the property.

**Signature:**

    example?: unknown;

## Schema.format

Optional. The format of the property. Supported formats:  

- for NUMBER type: "float", "double"
- for INTEGER type: "int32", "int64"
- for STRING type: "email", "byte", etc

<br />

**Signature:**

    format?: string;

## Schema.items

Optional. The items of the property.

**Signature:**

    items?: SchemaInterface;

## Schema.maxItems

The maximum number of items (elements) in a schema of [SchemaType](https://firebase.google.com/docs/reference/js/ai#schematype) `array`.

**Signature:**

    maxItems?: number;

## Schema.minItems

The minimum number of items (elements) in a schema of [SchemaType](https://firebase.google.com/docs/reference/js/ai#schematype) `array`.

**Signature:**

    minItems?: number;

## Schema.nullable

Optional. Whether the property is nullable. Defaults to false.

**Signature:**

    nullable: boolean;

## Schema.type

Optional. The type of the property. This can only be undefined when using `anyOf` schemas, which do not have an explicit type in the [OpenAPI specification](https://swagger.io/docs/specification/v3_0/data-models/data-types/#any-type).

**Signature:**

    type?: SchemaType;

## Schema.anyOf()

**Signature:**

    static anyOf(anyOfParams: SchemaParams & {
            anyOf: TypedSchema[];
        }): AnyOfSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| anyOfParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) \& { anyOf: [TypedSchema](https://firebase.google.com/docs/reference/js/ai#typedschema)\[\]; } |   |

**Returns:**

[AnyOfSchema](https://firebase.google.com/docs/reference/js/ai.anyofschema#anyofschema_class)

## Schema.array()

**Signature:**

    static array(arrayParams: SchemaParams & {
            items: Schema;
        }): ArraySchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| arrayParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) \& { items: [Schema](https://firebase.google.com/docs/reference/js/ai.schema#schema_class); } |   |

**Returns:**

[ArraySchema](https://firebase.google.com/docs/reference/js/ai.arrayschema#arrayschema_class)

## Schema.boolean()

**Signature:**

    static boolean(booleanParams?: SchemaParams): BooleanSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| booleanParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) |   |

**Returns:**

[BooleanSchema](https://firebase.google.com/docs/reference/js/ai.booleanschema#booleanschema_class)

## Schema.enumString()

**Signature:**

    static enumString(stringParams: SchemaParams & {
            enum: string[];
        }): StringSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| stringParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) \& { enum: string\[\]; } |   |

**Returns:**

[StringSchema](https://firebase.google.com/docs/reference/js/ai.stringschema#stringschema_class)

## Schema.integer()

**Signature:**

    static integer(integerParams?: SchemaParams): IntegerSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| integerParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) |   |

**Returns:**

[IntegerSchema](https://firebase.google.com/docs/reference/js/ai.integerschema#integerschema_class)

## Schema.number()

**Signature:**

    static number(numberParams?: SchemaParams): NumberSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| numberParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) |   |

**Returns:**

[NumberSchema](https://firebase.google.com/docs/reference/js/ai.numberschema#numberschema_class)

## Schema.object()

**Signature:**

    static object(objectParams: SchemaParams & {
            properties: {
                [k: string]: Schema;
            };
            optionalProperties?: string[];
        }): ObjectSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| objectParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) \& { properties: { \[k: string\]: [Schema](https://firebase.google.com/docs/reference/js/ai.schema#schema_class); }; optionalProperties?: string\[\]; } |   |

**Returns:**

[ObjectSchema](https://firebase.google.com/docs/reference/js/ai.objectschema#objectschema_class)

## Schema.string()

**Signature:**

    static string(stringParams?: SchemaParams): StringSchema;

#### Parameters

| Parameter | Type | Description |
|---|---|---|
| stringParams | [SchemaParams](https://firebase.google.com/docs/reference/js/ai.schemaparams#schemaparams_interface) |   |

**Returns:**

[StringSchema](https://firebase.google.com/docs/reference/js/ai.stringschema#stringschema_class)