# Extending the framework

## Introduction

VeinIF provides the foundation to easily create choice-based Interactive Fiction games, but for specific features . In the case where creators wants&#x20;

Can't find an example of what you're looking for? Please create a [new issues](https://github.com/uyen18827/VeinIF/issues/new/choose) on our GitHub page and describe your request.

## Example 1: Adding new property to the "Paragraphs" interface

Use case: suppose the programmer wants to add optional property "special" that will trigger a custom function.

First, create a new interface that extends the `Paragraphs` interface. The new interface will inherit all of `Paragraphs` 's property plus the addition of the `special` property.

```typescript
interface ParagraphPlus extends Paragraphs {
  special?: string;
}

export function getParagraph(player?: Player) {
  let paragraphs: ParagraphPlus[] = [ ... ]
```

Next, navigate to `src/core/paragraphsFunction.ts`. In `updateParagraph()`, add the necessary function to handle your new property.
