mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Fix missing setOptions arg
This commit is contained in:
parent
2421842822
commit
c326abb53b
@ -2,17 +2,21 @@ import AceDiff = require('ace-diff');
|
||||
|
||||
new AceDiff(); // $ExpectError
|
||||
|
||||
const aceDiffOpts = {
|
||||
const aceDiffConstructorOpts = {
|
||||
element: '.acediff',
|
||||
left: { content: 'left content' },
|
||||
right: { content: 'left content' },
|
||||
right: { content: 'right content' },
|
||||
};
|
||||
new AceDiff(aceDiffOpts); // $ExpectType AceDiff
|
||||
new AceDiff(aceDiffConstructorOpts); // $ExpectType AceDiff
|
||||
|
||||
const differ = new AceDiff(aceDiffOpts);
|
||||
const differ = new AceDiff(aceDiffConstructorOpts);
|
||||
|
||||
differ.getEditors(); // $ExpectType { left: any; right: any; }
|
||||
differ.setOptions(); // $ExpectType void
|
||||
differ.setOptions(); // $ExpectError
|
||||
const aceDiffOpts = {
|
||||
diffGranularity: 'broad' as 'broad', // workaround: cast to avoid https://github.com/Microsoft/TypeScript/issues/11465#issuecomment-252453037
|
||||
};
|
||||
differ.setOptions(aceDiffOpts); // $ExpectType void
|
||||
differ.getNumDiffs(); // $ExpectType number
|
||||
differ.diff(); // $ExpectType void
|
||||
differ.destroy(); // $ExpectType void
|
||||
|
||||
15
types/ace-diff/index.d.ts
vendored
15
types/ace-diff/index.d.ts
vendored
@ -8,12 +8,12 @@ export as namespace AceDiff;
|
||||
export = AceDiff;
|
||||
|
||||
declare class AceDiff {
|
||||
constructor(opts: AceDiff.AceDiffOpts);
|
||||
constructor(opts: AceDiff.AceDiffConstructorOpts);
|
||||
getEditors(): {
|
||||
left: any;
|
||||
right: any;
|
||||
};
|
||||
setOptions(): void;
|
||||
setOptions(options: AceDiff.AceDiffOpts): void;
|
||||
getNumDiffs(): number;
|
||||
diff(): void;
|
||||
destroy(): void;
|
||||
@ -27,16 +27,21 @@ declare namespace AceDiff {
|
||||
copyLinkEnabled?: boolean;
|
||||
}
|
||||
|
||||
interface AceDiffOpts {
|
||||
interface AceDiffConstructorOpts extends AceDiffOpts {
|
||||
element: string | HTMLElement;
|
||||
left: AceDiffLROpts;
|
||||
right: AceDiffLROpts;
|
||||
}
|
||||
|
||||
interface AceDiffOpts {
|
||||
mode?: string;
|
||||
theme?: string;
|
||||
diffGranularity?: 'specific' | 'broad';
|
||||
showDiffs?: boolean;
|
||||
showConnectors?: boolean;
|
||||
maxDiffs?: number;
|
||||
left: AceDiffLROpts;
|
||||
right: AceDiffLROpts;
|
||||
left?: AceDiffLROpts;
|
||||
right?: AceDiffLROpts;
|
||||
classes?: {
|
||||
diff: string;
|
||||
connector: string;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user