module Rouge::Lexers::TypescriptCommon

def self.extended(base)

def self.extended(base)
  base.prepend :root do
    rule %r/[?][.]/, base::Punctuation
    rule %r/[?]{2}/, base::Operator
    # Positive Examples:
    # const cat = { name: "Garfield" } satisfies Person;
    # import {something as thingy} from 'module'
    # export { foo as default }
    # ...spreadOperator as const;
    # Negative Example:
    # cy.get('kitten').as('friend')
    rule %r{(?<![_$[:alnum:]])(?:(?<=\.\.\.)|(?<!\.))(?:(as)|(satisfies))\s+}, base::Keyword::Declaration
  end
  base.prepend :statement do
    rule %r/(#{Javascript.id_regex})(\??)(\s*)(:)/ do
      groups base::Name::Label, base::Punctuation, base::Text, base::Punctuation
      push :expr_start
    end
  end
end