This repository has been archived by the owner on Sep 11, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 828
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable tsc alwaysStrict, strictBindCallApply, noImplicitThis (#9600)
* Enable tsc alwaysStrict * Enable tsc strictBindCallApply * Enable tsc noImplicitThis * Add d.ts * Improve types * Add ? * Increase coverage * Improve coverage
- Loading branch information
Showing
23 changed files
with
188 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
Copyright 2022 The Matrix.org Foundation C.I.C. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
import * as commonmark from "commonmark"; | ||
|
||
declare module "commonmark" { | ||
export type Attr = [key: string, value: string]; | ||
|
||
export interface HtmlRenderer { | ||
// As far as @types/commonmark is concerned, these are not public, so add them | ||
// https://github.com/commonmark/commonmark.js/blob/master/lib/render/html.js#L272-L296 | ||
text: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; | ||
html_inline: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; | ||
html_block: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; | ||
// softbreak: () => void; // This one can't be correctly specified as it is wrongly defined in @types/commonmark | ||
linebreak: (this: commonmark.HtmlRenderer) => void; | ||
link: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
image: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
emph: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
strong: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
paragraph: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
heading: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
code: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; | ||
code_block: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; | ||
thematic_break: (this: commonmark.HtmlRenderer, node: commonmark.Node) => void; | ||
block_quote: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
list: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
item: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
custom_inline: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
custom_block: (this: commonmark.HtmlRenderer, node: commonmark.Node, entering: boolean) => void; | ||
esc: (s: string) => string; | ||
out: (this: commonmark.HtmlRenderer, text: string) => void; | ||
tag: (this: commonmark.HtmlRenderer, name: string, attrs?: Attr[], selfClosing?: boolean) => void; | ||
attrs: (this: commonmark.HtmlRenderer, node: commonmark.Node) => Attr[]; | ||
// These are inherited from the base Renderer | ||
lit: (this: commonmark.HtmlRenderer, text: string) => void; | ||
cr: (this: commonmark.HtmlRenderer) => void; | ||
} | ||
} |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.