<commit_before>import { FieldProcessorAdt, FieldSchema, ValueSchema } from '@ephox/boulder';
import { Fun, Merger, Obj } from '@ephox/katamari';

import { AlloySpec, SketchSpec, LooseSpec } from '../../api/component/SpecTypes';
import * as FunctionAnnotator from '../../debugging/FunctionAnnotator';
import * as AlloyParts from '../../parts/AlloyParts';
import * as GuiTypes from './GuiTypes';
import * as UiSketcher from './UiSketcher';
import { SingleSketchFactory, CompositeSketchFactory } from './UiSketcher';

// TYPIFY: Not sure what goes in this yet.
export interface SingleSketchSpec { };
export interface SingleSketchDetail { };

export interface SingleSketch<S extends SingleSketchSpec, D extends SingleSketchDetail> {
  name: () => string;
  configFields: () => FieldProcessorAdt[];
  sketch: (spec: S) => SketchSpec;
  factory: SingleSketchFactory<D, S>;
  [key: string]: Function;
}

export interface CompositeSketchSpec { };
export interface CompositeSketchDetail {
  partUids: () => Record<string, string>;
  components: () => AlloySpec[];
};

export interface CompositeSketch<S extends CompositeSketchSpec, D extends CompositeSketchDetail>  {
  name: () => string;
  configFields: () => FieldProcessorAdt[];
  partFields: () => FieldProcessorAdt[];
  sketch: (spec: S) => SketchSpec;
  parts: () => AlloyParts.GeneratedParts;
  // TYPIFY externals
  factory: CompositeSketchFactory<D, S>;
  [key: string]: Function;
}

export function isSketchSpec(spec: AlloySpec): spec is SketchSpec {<commit_msg>sketcher-typing: removing general apis<commit_after>import { FieldProcessorAdt, FieldSchema, ValueSchema } from '@ephox/boulder';
import { Fun, Merger, Obj } from '@ephox/katamari';

import { AlloySpec, SketchSpec, LooseSpec } from '../../api/component/SpecTypes';
import * as FunctionAnnotator from '../../debugging/FunctionAnnotator';
import * as AlloyParts from '../../parts/AlloyParts';
import * as GuiTypes from './GuiTypes';
import * as UiSketcher from './UiSketcher';
import { SingleSketchFactory, CompositeSketchFactory } from './UiSketcher';

// TYPIFY: Not sure what goes in this yet.
export interface SingleSketchSpec { };
export interface SingleSketchDetail { };

export interface SingleSketch<S extends SingleSketchSpec, D extends SingleSketchDetail> {
  name: () => string;
  configFields: () => FieldProcessorAdt[];
  sketch: (spec: S) => SketchSpec;
  factory: SingleSketchFactory<D, S>;
}

export interface CompositeSketchSpec { };
export interface CompositeSketchDetail {
  partUids: () => Record<string, string>;
  components: () => AlloySpec[];
};

export interface CompositeSketch<S extends CompositeSketchSpec, D extends CompositeSketchDetail>  {
  name: () => string;
  configFields: () => FieldProcessorAdt[];
  partFields: () => FieldProcessorAdt[];
  sketch: (spec: S) => SketchSpec;
  parts: () => AlloyParts.GeneratedParts;
  // TYPIFY externals
  factory: CompositeSketchFactory<D, S>;
}

export function isSketchSpec(spec: AlloySpec): spec is SketchSpec {
{'fraction_non_alphanumeric': 0.13404468156052018, 'fraction_numerical': 0.0, 'mean_word_length': 5.263048016701461, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2547016', 'n_tokens_mistral': 915, 'n_tokens_neox': 926, 'n_words': 247}