TeamSQL Extension Project Structure

Before beginning work on your TeamSQL extension, please read this guide for information on the required structure for your project folders.

Required Files

The following is a list of files that you must have within your project folder. All file names are case-sensitive.

  • Root Folder
    • README.MD
    • icon.png
    • index.js
    • package.json

The main file, index.js, must have a JavaScript class name TeamSQLExtension.

You can have as many additional files as you'd like in the root or sub-folders, as long as the required files are present and correctly named.

README.MD

The README.MD file should have a well-written description of your extension, as well as pertinent images, usage instructions, and so on. If we approve your extension and it becomes available in the TeamSQL Extension Store, this file's content will be used for its description.

icon.png

Please include an icon image to be used with your extension. It must be sized 512x512 px in PNG format.

index.js

This is the main file of your extension, and it contains a JavaScript class named TeamSQLExtension.

This is one way you can include the class:

export class TeamSQLExtension extends Extension implements IExtensionContextMenu {
    ...
    ...
}

This is another way.

class TeamSQLExtension extends Extension {
    ...
    ...
}

Your main class (the TeamSQLExtension class in index.js ) must extend from Extension class and implement one of the interfaces available via the TeamSQL Extension SDK. You must implement the required functions of the interface in your main file.

package.json

This is an example of a complete package.json file:

{
  "name": "my-extension",
  "version": "1.0.0",
  "description": "My cool TeamSQL extension",
  "main": "index",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "Can Abacigil <[email protected]>",
  "license": "MIT",
  "devDependencies": {
    "typings": "2.1.0",
    "@types/node": "^7.0.10"
  },
  "dependencies": {
    "@teamsql-extensions/ts-extension-sdk": "^0.2.4",
    "query-string": "^5.0.0"
  },
  "teamsql": {
    "id": "my-unique-extension-id",
    "type": "context-menu",
    "secret": "my-very-secret-random-generated-id",
    "name": "My Extension's Friendly Name"
  }
}

For detailed documentation please see npm's package.json docs

Key/Property Notes on the Property's Value
main The value of `main` must be `index`
teamsql.id This is identical to npm's `name` property and will be the ID of your extension. It must be unique
teamsql.type In the future, TeamSQL will support multiple types of extensions, so you'll need to provide information on the type of extension you're creating. For now, we support `context-menu`
teamsql.secret If you're storing user data locally via the `UserDefaults` class, provide a secret to be used to create a cipher for the AES256 encryption.
teamsql.name The friendly name of your extension; this will be used for your extension in the Extension Store.

results matching ""

    No results matching ""