"use strict"; const typeRules = require("./type-rules"); const createType = require("./create-type"); const createTrait = require("./create-trait"); const guardFunction = require("./guard-function"); const errors = require("./errors"); /* Traits: - Special 'slot' value; for use in trait implementations to indicate that the specified trait definition property should be filled in by the instance constructor, not by the trait implementation Possible field types for a trait: - Static value [add the value to the type's prototype?] - Type/validation rule [check against implementation, see below] Possible field types for a trait implementation (all of them fill in type/validation rules): - Static value, including an appropriately guarded function [add the value to the type's prototype?] - Slot [add the trait rule to the type rules] Disallow extra fields in trait implementations! TODO: Add full property paths to errors? */ module.exports = Object.assign({ createType: createType, createTrait: createTrait, guard: guardFunction, ValidationError: errors.ValidationError }, typeRules);