Commit e0f917aa authored by Fred Eisele's avatar Fred Eisele
Browse files

initial (broken) typings for jsedn

parent 14391f93
Loading
Loading
Loading
Loading
+3 −73
Changes for README.md: 3 added lines, 73 removed lines.
Original line number Diff line number Diff line
@@ -2,78 +2,8 @@
Each branch represents a different set of typescript typings that I am working on.

## New Project
## jsedn

To create a new set of typings...

   git checkout master
   git checkout -b <new-project-name>

   edit the files as needed (see below for hints)
   git commit -m 'initial commit of sample'

The projects that have been previously commited 
are good samples of the types of edits you will need 
for your porject.

   git difftool master n3 

## Sync with DefinitelyTyped

In order to get you typings into the offical npm repository
you will need to convert your project typings and place
them in a DefinitelyTyped directory.

  * http://definitelytyped.org/
  * https://github.com/DefinitelyTyped/DefinitelyTyped


To make a new set of typings:
 * Checkout and develop the description files from DefinitelyTyped
     Development is easier here because you have the 
       advantage of having your reference-paths working properly.
     
 * branch from the master
     git checkout master
     git checkout -b newpackage
 * edit the `package.json`
     "name": "@types/sample",
     "version": "0.0.1",
     "description": "A set of TypeScript definitions for SAMPLE",
     "main": "",
     "files": [
       "index.d.ts"
     ],
 * add in the files from DefinitelyTyped
     cp <DT>/n3/* .
     index.d.ts
     newpackage-tests.ts

## Project Log

### N3

  git checkout n3

Lightning fast, spec-compatible, streaming RDF for JavaScript.

 * https://github.com/RubenVerborgh/N3.js

### webgme

  git checkout webgme

Web based generic modeling environment.

 * https://webgme.org/
 * https://github.com/webgme/webgme

### Cytoscape

  git checkout cytoscape

Graph theory (a.k.a. network) library for analysis and visualisation.

 * http://js.cytoscape.org/
 * https://github.com/cytoscape/cytoscape.js

A javascript implementation of edn.

 * https://github.com/shaunxcode/jsedn
 No newline at end of file
+18 −13
Changes for index.d.ts: 18 added lines, 13 removed lines.
Original line number Diff line number Diff line
// Type definitions for <SAMPLE> v0.0.1 
// Project: https://github.com/<SAMPLE>.js
// Type definitions for jsedn v0.1.0 
// Project: https://github.com/shawnxcode/jsedn
// Definitions by: Fred Eisele <https://github.com/phreed>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

/**
### 0.0.1 Changelog (https://github.com/<SAMPLE>)

#### TODO:

Match samples from README.md

- [x] do it.
### 0.1.0 Changelog (https://github.com/<SAMPLE>)

*/

declare module "sample" {
import * as fs from "fs";

    namespace Sample {
declare namespace JSEDN {
    
   function parse(ednString: string): EDN;

        type Dictionary = { [key: string]: any };
   class Vector {
     new (indexed: any);
   }

   class KW {
     new (name: string);
   }

   interface EDN {
       at(vector: Vector): EDN;
       at(kw: KW): EDN;
   }

    export = Sample;
}
export = JSEDN;

+3 −5
Changes for jsedn-tests.ts: 3 added lines, 5 removed lines.
Original line number Diff line number Diff line
@@ -17,11 +17,9 @@

*/

import * as Sample from "sample";
import * as fs from "fs";
import * as stream from "stream";
import edn = require("jsedn");

function test_it() {
let map = edn.parse("{:a 5 [1 2] {:name :mike :age 40}}");
console.log(map.at(new edn.Vector([1, 2])).at(edn.kw(":name")));

}
+5 −5
Changes for package.json: 5 added lines, 5 removed lines.
Original line number Diff line number Diff line
{
  "name": "@types/SAMPLE",
  "version": "0.0.1",
  "description": "A set of TypeScript definitions for SAMPLE",
  "name": "@types/jsedn",
  "version": "0.1.0",
  "description": "A set of TypeScript definitions for jsedn",
  "main": "",
  "typings": "index.d.ts",
  "files": [
@@ -9,14 +9,14 @@
  ],
  "keywords": [
    "typescript",
    "SAMPLE",
    "jsedn",
    "defininition"
  ],
  "directories": {
    "test": "test"
  },
  "dependencies": {
    "typescript": "^2.1.1"
    "typescript": "^2.2.1"
  },
  "devDependencies": {
    "ts-node": "^1.7.0"
+5 −3
Changes for tsconfig.json: 5 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -3,17 +3,19 @@
        "module": "commonjs",
        "target": "es6",
        "noImplicitAny": true,
        "strictNullChecks": false,
        "strictNullChecks": true,
        "baseUrl": "../",
        "typeRoots": [
            "../"
        ],
        "types": [],
        "types": [
            "node"
        ],
        "noEmit": true,
        "forceConsistentCasingInFileNames": true
    },
    "files": [
        "index.d.ts",
        "SAMPLE-tests.ts"
        "jsedn-tests.ts"
    ]
}