/** * Copyright 2017 Matt Acosta * * 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 { INode } from '../node/INode'; import { ISyntaxNode } from './ISyntaxNode'; import { ISyntaxToken } from './ISyntaxToken'; import { ISyntaxTrivia } from './ISyntaxTrivia'; import { TextSpan } from '../../text/TextSpan'; import { TokenKind } from '../TokenKind'; /** * Represents an insignificant token within a syntax tree. */ export declare class SyntaxTrivia implements ISyntaxTrivia { /** * @inheritDoc */ readonly token: ISyntaxToken; /** * @todo Experimental. */ protected readonly index: number; /** * An object containing the metadata for this trivia. */ protected readonly node: INode | null; /** * The absolute location of this token in the source text. * * @see SyntaxToken.span * @see SyntaxToken.fullSpan */ protected readonly offset: number; /** * Constructs a `SyntaxTrivia` object. */ constructor(node: INode | null, token: ISyntaxToken, offset: number, index: number); /** * @inheritDoc */ get containsStructuredTrivia(): boolean; /** * @inheritDoc */ get containsSkippedText(): boolean; /** * @inheritDoc */ get fullSpan(): TextSpan; /** * @inheritDoc */ get kind(): TokenKind; /** * @inheritDoc */ get span(): TextSpan; /** * Determines if the trivia was created from a skipped token. */ static isSkippedToken(trivia: ISyntaxTrivia): boolean; /** * @inheritDoc */ equals(value: SyntaxTrivia): boolean; /** * @inheritDoc */ getStructure(): ISyntaxNode | null; }