Skip to content

Commit

Permalink
Merge of #622
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Nov 14, 2022
2 parents cb5ee7c + 9420090 commit a9cfa5e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 103 deletions.
100 changes: 0 additions & 100 deletions src/Types.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,3 @@
export interface Def {
name: GlobalName;
term?: Tree;
type_: Tree;
}
export type GlobalName = {
baseName: string;
qualifiedModule: string[];
};

export type OfferedAction = {
actionType: ActionType;
description: string;
name: { tag: "Code"; contents: string } | { tag: "Prose"; contents: string };
priority: number;
};
export type ActionType = "Primary" | "Destructive";

export type NodeType = "BodyNode" | "SigNode";

// Abstract avatar styles.
export type AvatarStyle = "bottts" | "identicon" | "jdenticon";

Expand All @@ -35,83 +15,3 @@ export interface SessionMeta {
name: string;
lastModified: Date;
}

/**
*
* @export
* @interface Tree
*/
export interface Tree {
body: NodeBody;
childTrees: Tree[];
nodeId: string;
rightChild?: Tree;
flavor: NodeFlavor;
}

export type NodeBody = NodeBodyOneOf | NodeBodyOneOfThree | NodeBodyOneOfFive;
export type NodeBodyOneOf = {
contents: string;
tag: NodeBodyOneOfTag;
};
export type NodeBodyOneOfFive = {
tag: NodeBodyOneOfFiveTag;
};
export type NodeBodyOneOfFiveTag =
typeof NodeBodyOneOfFiveTag[keyof typeof NodeBodyOneOfFiveTag];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NodeBodyOneOfFiveTag = {
NoBody: "NoBody",
} as const;
export type NodeBodyOneOfTag =
typeof NodeBodyOneOfTag[keyof typeof NodeBodyOneOfTag];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NodeBodyOneOfTag = {
TextBody: "TextBody",
} as const;
export type NodeBodyOneOfThree = {
contents: Tree;
tag: NodeBodyOneOfThreeTag;
};
export type NodeBodyOneOfThreeTag =
typeof NodeBodyOneOfThreeTag[keyof typeof NodeBodyOneOfThreeTag];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NodeBodyOneOfThreeTag = {
BoxBody: "BoxBody",
} as const;
export type NodeFlavor = typeof NodeFlavor[keyof typeof NodeFlavor];

// eslint-disable-next-line @typescript-eslint/no-redeclare
export const NodeFlavor = {
FlavorHole: "FlavorHole",
FlavorEmptyHole: "FlavorEmptyHole",
FlavorAnn: "FlavorAnn",
FlavorApp: "FlavorApp",
FlavorAPP: "FlavorAPP",
FlavorCon: "FlavorCon",
FlavorLam: "FlavorLam",
FlavorLAM: "FlavorLAM",
FlavorGlobalVar: "FlavorGlobalVar",
FlavorLocalVar: "FlavorLocalVar",
FlavorLet: "FlavorLet",
FlavorLetType: "FlavorLetType",
FlavorLetrec: "FlavorLetrec",
FlavorCase: "FlavorCase",
FlavorCaseWith: "FlavorCaseWith",
FlavorPrimCon: "FlavorPrimCon",
FlavorTEmptyHole: "FlavorTEmptyHole",
FlavorTHole: "FlavorTHole",
FlavorTCon: "FlavorTCon",
FlavorTFun: "FlavorTFun",
FlavorTVar: "FlavorTVar",
FlavorTApp: "FlavorTApp",
FlavorTForall: "FlavorTForall",
FlavorTLet: "FlavorTLet",
FlavorPattern: "FlavorPattern",
FlavorPatternCon: "FlavorPatternCon",
FlavorPatternBind: "FlavorPatternBind",
FlavorPatternApp: "FlavorPatternApp",
} as const;
2 changes: 1 addition & 1 deletion src/components/TreeReactFlow/TreeReactFlow.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
oddEvenTrees,
oddEvenTreesMiscStyles,
} from "@/components/examples/trees";
import { Tree } from "@/Types";
import { Tree } from "@/primer-api";

export default {
title: "Application/Component Library/TreeReactFlow",
Expand Down
2 changes: 1 addition & 1 deletion src/components/TreeReactFlow/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Def, GlobalName, NodeFlavor, NodeType, Tree } from "@/Types";
import { Def, GlobalName, NodeFlavor, NodeType, Tree } from "@/primer-api";
import ReactFlow, {
Edge,
Node,
Expand Down
2 changes: 1 addition & 1 deletion src/components/examples/trees.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { Tree } from "@/Types";
import type { Tree } from "@/primer-api";

/*
Some example trees.
Expand Down

0 comments on commit a9cfa5e

Please sign in to comment.