~didrocks/+junk/face-detection-15.04

« back to all changes in this revision

Viewing changes to facedetection/www/bower_components/hydrolysis/custom_typings/dom5.d.ts

  • Committer: Didier Roche
  • Date: 2016-05-10 23:09:11 UTC
  • Revision ID: didier.roche@canonical.com-20160510230911-c7xr490zrj3yrzxd
New version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// TODO(rictic): upstream this to dom5 itself.
 
2
 
 
3
declare module 'dom5' {
 
4
  export interface Node {
 
5
    nodeName: string;
 
6
    tagName: string;
 
7
    childNodes: Node[];
 
8
    parentNode: Node;
 
9
    attrs: Attr[];
 
10
    value?: string;
 
11
    data?: string;
 
12
    __location?: {
 
13
      start: number;
 
14
    }
 
15
  }
 
16
  export interface Attr {
 
17
    name: string;
 
18
    value: string;
 
19
  }
 
20
  interface ParseOptions {
 
21
    locationInfo: boolean;
 
22
  }
 
23
 
 
24
  export function parse(text: string, opts?: ParseOptions):Node;
 
25
  export function parseFragment(text: string, opts?: ParseOptions):Node;
 
26
 
 
27
  export function serialize(node: Node): string;
 
28
 
 
29
  export type Predicate = (n:Node) => boolean;
 
30
  export function query(root: Node, predicate: Predicate):Node;
 
31
  export function queryAll(root: Node, predicate: Predicate):Node[];
 
32
  export function nodeWalk(node: Node, predicate: Predicate):Node;
 
33
  export function nodeWalkAll(node: Node, predicate: Predicate):Node[];
 
34
  export function nodeWalkAllPrior(node: Node, predicate: Predicate):Node[];
 
35
  export function treeMap(node: Node, walker:(node: Node)=>void):void;
 
36
  export function getAttribute(node: Node, attrName: string): string;
 
37
  export function removeAttribute(node: Node, attrName: string): string;
 
38
  export function getTextContent(node: Node): string;
 
39
  export function setTextContent(node: Node, string: string): void;
 
40
  export function append(parent: Node, newNode: Node): void;
 
41
  export function remove(willBeRemoved: Node): void;
 
42
  export function replace(current: Node, replacement: Node): void;
 
43
 
 
44
  export var isCommentNode: Predicate;
 
45
  interface PredicateCombinators {
 
46
    hasTagName(name: string):Predicate;
 
47
    hasAttr(name: string): Predicate;
 
48
    hasAttrValue(name: string, value: string): Predicate;
 
49
    NOT(pred: Predicate):Predicate;
 
50
    AND(...preds: Predicate[]):Predicate;
 
51
    OR(...preds: Predicate[]):Predicate;
 
52
  }
 
53
  export var predicates: PredicateCombinators;
 
54
 
 
55
  interface Constructors {
 
56
    element(tagName: string): Node;
 
57
    text(content: string): Node;
 
58
  }
 
59
  export var constructors: Constructors;
 
60
}