mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Accept Position with extra properties
Delete `Node` interface because we are needed to check the properties about position only.
This commit is contained in:
Vendored
+3
-11
@@ -18,12 +18,6 @@ declare namespace vfile {
|
||||
end: Point;
|
||||
}
|
||||
|
||||
interface Node {
|
||||
type: string;
|
||||
data?: {};
|
||||
position?: Position;
|
||||
}
|
||||
|
||||
interface VFileParamsBase<D> {
|
||||
data?: D;
|
||||
contents?: Contents;
|
||||
@@ -49,13 +43,11 @@ declare namespace vfile {
|
||||
fatal?: boolean | null;
|
||||
}
|
||||
|
||||
type StringifiablePosition = Point | Position | Node;
|
||||
type Message = <P extends Position>(reason: string, position?: Point | P, ruleId?: string) => VFileError;
|
||||
|
||||
type Message = (reason: string, position?: StringifiablePosition, ruleId?: string) => VFileError;
|
||||
type Fail = <P extends Position>(reason: string, position?: Point | P, ruleId?: string) => never;
|
||||
|
||||
type Fail = (reason?: string, position?: StringifiablePosition, ruleId?: string) => never;
|
||||
|
||||
type Info = (reason?: string, position?: StringifiablePosition, ruleId?: string) => void;
|
||||
type Info = <P extends Position>(reason: string, position?: Point | P, ruleId?: string) => void;
|
||||
|
||||
type ToString = (encoding?: BufferEncoding) => string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user