UNPKG

2.12 kBJavaScriptView Raw
1"use strict";
2exports.__esModule = true;
3exports.FormattingState = void 0;
4var config_1 = require("./config");
5var FormattingState = /** @class */ (function () {
6 function FormattingState() {
7 this.lines = [];
8 /** Current line index. */
9 this.currentLine = 0;
10 this.LINE_ENDING = '\n';
11 /** Formatting Result */
12 this.RESULT = '';
13 /** Context For Each Line. */
14 this.LOCAL_CONTEXT = {
15 isAdjacentSelector: false,
16 isHtmlTag: false,
17 isReset: false,
18 indentation: {
19 distance: 0,
20 offset: 0
21 },
22 isAtExtend: false,
23 isAnd: false,
24 isClassOrIdSelector: false,
25 isIf: false,
26 isElse: false,
27 isAtKeyframes: false,
28 isAtKeyframesPoint: false,
29 isProp: false,
30 isInterpolatedProp: false,
31 isInclude: false,
32 isVariable: false,
33 isImport: false,
34 isNestPropHead: false
35 };
36 this.CONTEXT = {
37 "if": {
38 isIn: false,
39 indentation: 0
40 },
41 blockCommentDistance: 0,
42 wasLastHeaderIncludeMixin: false,
43 wasLastHeaderNestedProp: false,
44 isFirstLine: true,
45 isLastLine: false,
46 allowSpace: false,
47 isInBlockComment: false,
48 ignoreLine: false,
49 lastSelectorIndentation: 0,
50 wasLastLineSelector: false,
51 convert: {
52 lastSelector: '',
53 wasLastLineCss: false
54 },
55 keyframes: {
56 isIn: false,
57 indentation: 0
58 },
59 indentation: 0,
60 firstCommaHeader: { exists: false, distance: 0 }
61 };
62 this.CONFIG = config_1.defaultSassFormatterConfig;
63 }
64 FormattingState.prototype.setLocalContext = function (context) {
65 this.LOCAL_CONTEXT = context;
66 };
67 return FormattingState;
68}());
69exports.FormattingState = FormattingState;