How to use the @glimmer/util.tuple function in @glimmer/util

To help you get started, we’ve selected a few @glimmer/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
import * as AST from '../types/nodes';

// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),

  Hash: tuple('pairs'),
  HashPair: tuple('value'),
};
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';

// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';

// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';

// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),

  Hash: tuple('pairs'),
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';

// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
import { tuple } from '@glimmer/util';
import * as AST from '../types/nodes';

// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
// ensure stays in sync with typing
// ParentNode and ChildKey types are derived from VisitorKeysMap
const visitorKeys = {
  Program: tuple('body'),
  Template: tuple('body'),
  Block: tuple('body'),

  MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),

  Hash: tuple('pairs'),
  HashPair: tuple('value'),
};
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),

  Hash: tuple('pairs'),
  HashPair: tuple('value'),
};

type VisitorKeysMap = typeof visitorKeys;

export type VisitorKeys = { [P in keyof VisitorKeysMap]: VisitorKeysMap[P][number] };
export type VisitorKey = VisitorKeys[N['type']] & keyof N;

export default visitorKeys;
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),

  Hash: tuple('pairs'),
  HashPair: tuple('value'),
};

type VisitorKeysMap = typeof visitorKeys;

export type VisitorKeys = { [P in keyof VisitorKeysMap]: VisitorKeysMap[P][number] };
export type VisitorKey = VisitorKeys[N['type']] & keyof N;

export default visitorKeys;
github glimmerjs / glimmer-vm / packages / @glimmer / syntax / lib / types / visitor-keys.ts View on Github external
MustacheStatement: tuple('path', 'params', 'hash'),
  BlockStatement: tuple('path', 'params', 'hash', 'program', 'inverse'),
  ElementModifierStatement: tuple('path', 'params', 'hash'),
  PartialStatement: tuple('name', 'params', 'hash'),
  CommentStatement: tuple(),
  MustacheCommentStatement: tuple(),
  ElementNode: tuple('attributes', 'modifiers', 'children', 'comments'),
  AttrNode: tuple('value'),
  TextNode: tuple(),

  ConcatStatement: tuple('parts'),
  SubExpression: tuple('path', 'params', 'hash'),
  PathExpression: tuple(),

  StringLiteral: tuple(),
  BooleanLiteral: tuple(),
  NumberLiteral: tuple(),
  NullLiteral: tuple(),
  UndefinedLiteral: tuple(),

  Hash: tuple('pairs'),
  HashPair: tuple('value'),
};

type VisitorKeysMap = typeof visitorKeys;

export type VisitorKeys = { [P in keyof VisitorKeysMap]: VisitorKeysMap[P][number] };
export type VisitorKey = VisitorKeys[N['type']] & keyof N;

export default visitorKeys;