Skip to content
This repository was archived by the owner on Oct 4, 2020. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 88 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,97 @@

## Module DOM

### Types
#### `DOM`

data DOM :: !
``` purescript
data DOM :: !
```

data Node :: *
Effect type for DOM maniupulation

data NodeList :: *
#### `Node`

``` purescript
data Node :: *
```

General type for DOM nodes.

#### `NodeList`

``` purescript
data NodeList :: *
```

General type for DOM node lists.


## Module DOM.File


Types for the [W3C File API](http://dev.w3.org/2006/webapi/FileAPI/).

#### `File`

``` purescript
data File :: *
```

A `File` object instance.

#### `FileList`

``` purescript
data FileList :: *
```

A `FileList` object instance.

#### `FileReader`

``` purescript
data FileReader :: *
```

A `FileReader` object instance.

#### `Blob`

``` purescript
data Blob :: *
```

A `Blob` object instance.


## Module DOM.XHR


Types for the [WHATWG XMLHttpRequest Living Standard](https://xhr.spec.whatwg.org/#interface-formdata).

#### `XMLHttpRequest`

``` purescript
data XMLHttpRequest :: *
```

An `XMLHttpRequest` object instance.

#### `FormData`

``` purescript
data FormData :: *
```

A `FormData` object instance.

#### `ProgressEvent`

``` purescript
data ProgressEvent :: *
```

A `ProgressEvent` object instance.



1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "purescript-dom",
"version": "0.1.0",
"description": "PureScript interface for the DOM.",
"license": "MIT"
}
63 changes: 19 additions & 44 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,52 +1,27 @@
'use strict'
"use strict";

var gulp = require('gulp')
, purescript = require('gulp-purescript')
;
var gulp = require("gulp");
var plumber = require("gulp-plumber");
var purescript = require("gulp-purescript");
var jsvalidate = require("gulp-jsvalidate");

var paths = {
src: 'src/**/*.purs',
bowerSrc: [
'bower_components/purescript-*/src/**/*.purs',
'bower_components/purescript-*/src/**/*.purs.hs'
],
dest: '',
docsDest: 'README.md'
};

var options = {};

var compile = function(compiler) {
var psc = compiler(options);
psc.on('error', function(e) {
console.error(e.message);
psc.end();
});
return gulp.src([paths.src].concat(paths.bowerSrc))
.pipe(psc)
.pipe(gulp.dest(paths.dest));
};

gulp.task('make', function() {
return compile(purescript.pscMake);
});

gulp.task('browser', function() {
return compile(purescript.psc);
});

gulp.task('docs', function() {
return gulp.src(paths.src)
.pipe(purescript.docgen())
.pipe(gulp.dest(paths.docsDest));
gulp.task("make", function() {
return gulp.src(["src/**/*.purs", "bower_components/purescript-*/src/**/*.purs"])
.pipe(plumber())
.pipe(purescript.pscMake());
});

gulp.task('watch-browser', function() {
gulp.watch(paths.src, ['browser', 'docs']);
gulp.task("jsvalidate", ["make"], function () {
return gulp.src("output/**/*.js")
.pipe(plumber())
.pipe(jsvalidate());
});

gulp.task('watch-make', function() {
gulp.watch(paths.src, ['make', 'docs']);
gulp.task("docs", function () {
return gulp.src("src/**/*.purs")
.pipe(plumber())
.pipe(purescript.pscDocs())
.pipe(gulp.dest("README.md"));
});

gulp.task('default', ['make', 'docs']);
gulp.task("default", ["jsvalidate", "docs"]);
11 changes: 5 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
{
"name": "purescript-dom",
"version": "0.0.0",
"description": "PureScript interface for the DOM.",
"license": "MIT",
"private": true,
"devDependencies": {
"gulp": "^3.8.1",
"gulp-purescript": "0.0.8"
"gulp": "^3.8.11",
"gulp-jsvalidate": "^1.0.1",
"gulp-plumber": "^1.0.0",
"gulp-purescript": "^0.1.2"
}
}
14 changes: 10 additions & 4 deletions src/DOM.purs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
module DOM where

foreign import data Node :: *

foreign import data NodeList :: *
-- | Effect type for DOM maniupulation
foreign import data DOM :: !

foreign import data DOM :: !
-- | General type for DOM documents.
foreign import data Document :: *

-- | General type for DOM nodes.
foreign import data Node :: *

-- | General type for DOM node lists.
foreign import data NodeList :: *
14 changes: 14 additions & 0 deletions src/DOM/File.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
-- | Types for the [W3C File API](http://dev.w3.org/2006/webapi/FileAPI/).
module DOM.File where

-- | A `File` object instance.
foreign import data File :: *

-- | A `FileList` object instance.
foreign import data FileList :: *

-- | A `FileReader` object instance.
foreign import data FileReader :: *

-- | A `Blob` object instance.
foreign import data Blob :: *
11 changes: 11 additions & 0 deletions src/DOM/XHR.purs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
-- | Types for the [WHATWG XMLHttpRequest Living Standard](https://xhr.spec.whatwg.org/#interface-formdata).
module DOM.XHR where

-- | An `XMLHttpRequest` object instance.
foreign import data XMLHttpRequest :: *

-- | A `FormData` object instance.
foreign import data FormData :: *

-- | A `ProgressEvent` object instance.
foreign import data ProgressEvent :: *