Skip to content

Instantly share code, notes, and snippets.

@mrjacobbloom
Last active October 2, 2020 22:26
Show Gist options
  • Select an option

  • Save mrjacobbloom/e044b43b25685542f23873089901e4f6 to your computer and use it in GitHub Desktop.

Select an option

Save mrjacobbloom/e044b43b25685542f23873089901e4f6 to your computer and use it in GitHub Desktop.
/**
* How to extend/augment the types for a 3rd-party TypeScript module. For example, if its DefinitelyTyped typings are incomplete.
* (In most cases it's better to submit a pull request to DefinitelyTyped with the corrected types!)
*/
declare module 'quill' {
const OrigQuill: typeof import('../../../node_modules/@types/quill').Quill;
class Quill extends OrigQuill {
// In this case, we're extending the type for the Quill class if it's using the "Bubble" theme
public theme?: {
options?: any;
tooltip?: {
root: HTMLDivElement;
hide: () => void;
show: () => void;
position: (reference) => void;
};
};
}
export default Quill;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment