This guide explains how to configure the Movian type definitions in Visual Studio Code for better syntax highlighting and IntelliSense support.
The code in this repository was inspired by and adapted from the work in the movian-plugin-dailymotion repository by facferreira.
-
Download the Type Definitions
- Clone this repository or download the
libs/moviandirectory
- Clone this repository or download the
-
Place the Type Definitions in Your Project
- Copy the
libs/moviandirectory into your project's root folder
- Copy the
-
Configure VSCode
- Open your project in VSCode
- Create a
jsconfig.jsonfile in your project root with the following content:
{
"compilerOptions": {
"checkJs": true,
"allowJs": true
},
"include": ["**/*.js", "libs/movian/**/*.d.ts"]
}- With the
jsconfig.jsonsetup, VSCode will automatically discover the type definitions - No need to add reference comments in your files
- Works for all JavaScript files in your project
- Add this comment at the top of specific files if needed:
/// <reference path="libs/movian/movian.d.ts" />- Only necessary if automatic discovery isn't working
- Useful for specific files that need explicit type references
After setup, you'll get:
-
Syntax Highlighting
- Proper highlighting for Movian API calls
- Color-coded parameters and methods
-
IntelliSense
- Auto-completion for Movian API methods
- Parameter hints and documentation
- Quick info tooltips
-
Error Checking
- Basic type checking for Movian API usage
- Warnings for incorrect parameter types
// No reference needed with jsconfig.json setup
var page = new Movian.Page();
page.appendItem("https://example.com", "video", {
title: "Example Video",
description: "This is an example video"
});If IntelliSense isn't working:
- Ensure
jsconfig.jsonis in the project root - Verify the type definition paths are correct
- Restart VSCode
- Check the VSCode JavaScript language server status
For detailed API documentation, refer to the JSDoc comments in each type definition file.