forked from microsoft/TypeScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrule.ts
More file actions
30 lines (26 loc) · 877 Bytes
/
rule.ts
File metadata and controls
30 lines (26 loc) · 877 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* @internal */
namespace ts.formatting {
export interface Rule {
// Used for debugging to identify each rule based on the property name it's assigned to.
readonly debugName: string;
readonly context: ReadonlyArray<ContextPredicate>;
readonly action: RuleAction;
readonly flags: RuleFlags;
}
export type ContextPredicate = (context: FormattingContext) => boolean;
export const anyContext: ReadonlyArray<ContextPredicate> = emptyArray;
export const enum RuleAction {
Ignore = 1 << 0,
Space = 1 << 1,
NewLine = 1 << 2,
Delete = 1 << 3,
}
export const enum RuleFlags {
None,
CanDeleteNewLines,
}
export interface TokenRange {
readonly tokens: ReadonlyArray<SyntaxKind>;
readonly isSpecific: boolean;
}
}