mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Added typings for CodeFlask (#39913)
* Added typings for CodeFlask * Updated to match with Prismjs
This commit is contained in:
committed by
Jesse Trinity
parent
3e084dc89f
commit
ea40bbb6b2
@@ -0,0 +1,12 @@
|
||||
import CodeFlask from 'codeflask';
|
||||
|
||||
const flask = new CodeFlask(new HTMLElement(), {
|
||||
language: 'js',
|
||||
defaultTheme: false
|
||||
});
|
||||
|
||||
flask.onUpdate((code) => { });
|
||||
|
||||
flask.updateCode('Test');
|
||||
|
||||
const code: string = flask.getCode();
|
||||
Vendored
+30
@@ -0,0 +1,30 @@
|
||||
// Type definitions for codeflask 1.4
|
||||
// Project: https://kazzkiq.github.io/CodeFlask/
|
||||
// Definitions by: Joachim Holwech <https://github.com/holwech>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
import { Languages } from 'prismjs';
|
||||
|
||||
export default class CodeFlask {
|
||||
constructor(selectorOrElement: string | HTMLElement, opts: options);
|
||||
onUpdate(callback: (code: string) => void): void;
|
||||
updateCode(newCode: string): void;
|
||||
getCode(): string;
|
||||
addLanguage(name: string, options: Languages): void;
|
||||
}
|
||||
|
||||
export interface options {
|
||||
language?: string;
|
||||
rtl?: boolean;
|
||||
tabSize?: number;
|
||||
enableAutocorrect?: boolean;
|
||||
lineNumbers?: boolean;
|
||||
defaultTheme?: boolean;
|
||||
areaId?: string;
|
||||
ariaLabelledby?: string;
|
||||
readonly?: boolean;
|
||||
handleTabs?: boolean;
|
||||
handleSelfClosingCharacters?: boolean;
|
||||
handleNewLineIndentation?: boolean;
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es5",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictFunctionTypes": true,
|
||||
"strictNullChecks": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"codeflask-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user