Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import { Option, Opaque, ProgramSymbolTable, ComponentCapabilities, ModuleLocator } from '@glimmer/interfaces';
import GlimmerObject from '@glimmer/object';
import { PrimitiveReference, Tag, combine, PathReference, TagWrapper, DirtyableTag } from '@glimmer/reference';
import { EMPTY_ARRAY, assign, Destroyable, expect } from '@glimmer/util';
import { Environment, Arguments, WithDynamicTagName, PreparedArguments, WithDynamicLayout, ElementOperations, Bounds, CapturedNamedArguments, DynamicScope, Invocation } from '@glimmer/runtime';
import { UpdatableReference } from '@glimmer/object-reference';
import { Attrs, createTemplate, AttrsDiff } from '../shared';
import LazyRuntimeResolver from '../modes/lazy/runtime-resolver';
import EagerRuntimeResolver from '../modes/eager/runtime-resolver';
import { TestComponentDefinitionState, TemplateMeta } from '../components';
export class EmberishCurlyComponent extends GlimmerObject {
public static positionalParams: string[] | string = [];
public dirtinessTag: TagWrapper = DirtyableTag.create();
public layout: { name: string, handle: number };
public name: string;
public tagName: Option = null;
public attributeBindings: Option = null;
public attrs: Attrs;
public element: Element;
public bounds: Bounds;
public parentView: Option = null;
public args: CapturedNamedArguments;
static create(args: { attrs: Attrs }): EmberishCurlyComponent {
return super.create(args) as EmberishCurlyComponent;
}
recompute() {
this.dirtinessTag.inner.dirty();
didUpdateAttrs: number;
didReceiveAttrs: number;
willInsertElement: number;
willUpdate: number;
willRender: number;
didInsertElement: number;
didUpdate: number;
didRender: number;
}
export interface HookedComponent {
hooks: ComponentHooks;
}
export class EmberishGlimmerComponent extends GlimmerObject {
public dirtinessTag: TagWrapper = DirtyableTag.create();
public attrs!: Attrs;
public element!: Element;
public bounds!: Bounds;
public parentView: Option = null;
static create(args: { attrs: Attrs }): EmberishGlimmerComponent {
return super.create(args) as EmberishGlimmerComponent;
}
recompute() {
this.dirtinessTag.inner.dirty();
}
didInitAttrs(_options: { attrs: Attrs }) {}
didUpdateAttrs(_diff: AttrsDiff) {}
didReceiveAttrs(_diff: AttrsDiff) {}
constructor(value: Object) {
this.tag = DirtyableTag.create();
assign(this, value);
}
}
didUpdateLayout(): void {}
didUpdate(): void {}
getDestructor({ component }: BasicCurlyComponentState): Destroyable {
return {
destroy() {
component.destroy();
},
};
}
}
export class BasicCurlyComponent {
public dirtinessTag: TagWrapper = DirtyableTag.create();
constructor(public args: BasicCurlyArgs) {}
recompute() {
this.dirtinessTag.inner.dirty();
}
destroy() {}
}
const BaseBasicCurlyComponent = class extends BasicCurlyComponent {};
import { PrimitiveReference } from '@glimmer/runtime';
import { TestComponentConstructor } from './types';
export interface EmberishCurlyComponentFactory
extends TestComponentConstructor {
fromDynamicScope?: string[];
positionalParams: Option;
create(options: { attrs: Attrs; targetObject: any }): EmberishCurlyComponent;
}
let GUID = 1;
export class EmberishCurlyComponent {
public static positionalParams: string[] | string = [];
public dirtinessTag: TagWrapper = DirtyableTag.create();
public layout!: { name: string; handle: number };
public name!: string;
public tagName: Option = null;
public attributeBindings: Option = null;
public attrs!: Attrs;
public element!: Element;
public bounds!: Bounds;
public parentView: Option = null;
public args!: CapturedNamedArguments;
public _guid: string;
static create(args: { attrs: Attrs }): EmberishCurlyComponent {
let c = new this();
for (let key of keys(args)) {
this.dirtinessTag.inner.dirty();
}
didInitAttrs(_options: { attrs: Attrs }) { }
didUpdateAttrs(_diff: AttrsDiff) { }
didReceiveAttrs(_diff: AttrsDiff) { }
willInsertElement() { }
willUpdate() { }
willRender() { }
didInsertElement() { }
didUpdate() { }
didRender() { }
}
export class EmberishGlimmerComponent extends GlimmerObject {
public dirtinessTag: TagWrapper = DirtyableTag.create();
public attrs: Attrs;
public element: Element;
public bounds: Bounds;
public parentView: Option = null;
static create(args: { attrs: Attrs }): EmberishGlimmerComponent {
return super.create(args) as EmberishGlimmerComponent;
}
recompute() {
this.dirtinessTag.inner.dirty();
}
didInitAttrs(_options: { attrs: Attrs }) { }
didUpdateAttrs(_diff: AttrsDiff) { }
didReceiveAttrs(_diff: AttrsDiff) { }
tag(name: PropertyKey): Tag {
let bookkeeping = this.bookkeeping;
let tag = bookkeeping[name];
if (tag === undefined) {
tag = DirtyableTag.create();
bookkeeping[name] = tag;
}
return tag;
}