mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-24 05:06:02 +08:00
Add definitions for ace-diff
This commit is contained in:
18
types/ace-diff/ace-diff-tests.ts
Normal file
18
types/ace-diff/ace-diff-tests.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import AceDiff = require('ace-diff');
|
||||
|
||||
new AceDiff(); // $ExpectError
|
||||
|
||||
const aceDiffOpts = {
|
||||
element: '.acediff',
|
||||
left: { content: 'left content' },
|
||||
right: { content: 'left content' },
|
||||
};
|
||||
new AceDiff(aceDiffOpts); // $ExpectType AceDiff
|
||||
|
||||
const differ = new AceDiff(aceDiffOpts);
|
||||
|
||||
differ.getEditors(); // $ExpectType { left: any; right: any; }
|
||||
differ.setOptions(); // $ExpectType void
|
||||
differ.getNumDiffs(); // $ExpectType number
|
||||
differ.diff(); // $ExpectType void
|
||||
differ.destroy(); // $ExpectType void
|
||||
47
types/ace-diff/index.d.ts
vendored
Normal file
47
types/ace-diff/index.d.ts
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
// Type definitions for ace-diff 2.1
|
||||
// Project: https://ace-diff.github.io/ace-diff/
|
||||
// Definitions by: Mike Dodge <https://github.com/innovation-team>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export as namespace AceDiff;
|
||||
|
||||
export = AceDiff;
|
||||
|
||||
declare class AceDiff {
|
||||
constructor(opts: AceDiff.AceDiffOpts);
|
||||
getEditors(): {
|
||||
left: any;
|
||||
right: any;
|
||||
};
|
||||
setOptions(): void;
|
||||
getNumDiffs(): number;
|
||||
diff(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
declare namespace AceDiff {
|
||||
interface AceDiffLROpts {
|
||||
content?: string | null;
|
||||
mode?: string;
|
||||
theme?: string;
|
||||
editable?: boolean;
|
||||
copyLinkEnabled?: boolean;
|
||||
}
|
||||
|
||||
interface AceDiffOpts {
|
||||
element: string | HTMLElement;
|
||||
mode?: string;
|
||||
theme?: string;
|
||||
diffGranularity?: 'specific' | 'broad';
|
||||
showDiffs?: boolean;
|
||||
showConnectors?: boolean;
|
||||
maxDiffs?: number;
|
||||
left: AceDiffLROpts;
|
||||
right: AceDiffLROpts;
|
||||
classes?: {
|
||||
diff: string;
|
||||
connector: string;
|
||||
newCodeConnectorLinkContent: string;
|
||||
deletedCodeConnectorLinkContent: string;
|
||||
};
|
||||
}
|
||||
}
|
||||
24
types/ace-diff/tsconfig.json
Normal file
24
types/ace-diff/tsconfig.json
Normal file
@@ -0,0 +1,24 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"ace-diff-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/ace-diff/tslint.json
Normal file
1
types/ace-diff/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user