> ## Documentation Index
> Fetch the complete documentation index at: https://docs.speckle.systems/llms.txt
> Use this file to discover all available pages before exploring further.

# Extension

> Base class for all extensions. Extensions are created via [_createExtension_](/developers/viewer/viewer-api#createextension) method from the viewer instance.

## Properties

### viewer

```typescript theme={null}
protected viewer: IViewer
```

All extensions hold a reference to the viewer implementation instance that spawned them

## Accessors

### enabled

```typescript theme={null}
get enabled(): boolean
set enabled(value: boolean)
```

All extensions should implement enabling/disabling themselves

### inject

```typescript theme={null}
get inject(): Array<Constructor<Extension>>
```

Gets the list of extensions that need to get injected on creation time. \
This is how an extension declares that it needs other extensions injected.
Injection is automatically done when calling [*createExtension*](/developers/viewer/viewer-api#createextension)

## Methods

### onEarlyUpdate

```typescript theme={null}
onEarlyUpdate(deltaTime?: number)
```

Update function called before the viewer's update

### onLateUpdate

```typescript theme={null}
onLateUpdate(deltaTime?: number)
```

Update function called after the viewer's update

### onRender

```typescript theme={null}
onRender();
```

Render function called after the viewer's render

### onResize

```typescript theme={null}
onResize();
```

Called whenever a resize happens
