This repository has been archived by the owner on Mar 13, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 19
Migrating to Typescript #121
Open
cgilson
wants to merge
13
commits into
googlearchive:master
Choose a base branch
from
cgilson:master
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
fa83bfb
Migrating to typescript
cgilson fedb6ba
Removing some 'any's, fixing export problem, adding return types
cgilson 8eb1f9b
Move argument definitions to their own library
justinfagnani 6a04db8
Merge pull request #127 from PolymerLabs/args
FredKSchott db35aef
Add logging libraries and basic debug logging
d45251c
Merge pull request #128 from PolymerLabs/lint-logging
FredKSchott 0039fe1
Migrating to typescript
cgilson 9b488ed
Removing some 'any's, fixing export problem, adding return types
cgilson 6748216
Merge branch 'master' of https://github.com/cgilson/polylint
cgilson ba12a7f
custom typing for plylog
cgilson d421581
adding typescript compile to travis, adding plylog to tsc buildpath
cgilson fc12285
Adding typings installation to travis
cgilson cab3c75
Adding typescript install to travis for node4
cgilson File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
node_modules | ||
bower_components | ||
*~ | ||
typings | ||
lib | ||
*~ | ||
*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
declare module "command-line-args" { | ||
interface ArgDescriptor { | ||
name: string; | ||
// type: Object; | ||
alias?: string; | ||
description: string; | ||
defaultValue?: any; | ||
defaultOption?: boolean; | ||
type: (val: string) => any; | ||
multiple?: boolean; | ||
} | ||
interface UsageOpts { | ||
title: string; | ||
header?: string; | ||
description?: string; | ||
} | ||
interface CLI { | ||
parse(): any; | ||
getUsage(opts: UsageOpts): string; | ||
} | ||
|
||
function commandLineArgs(args: ArgDescriptor[]): CLI; | ||
namespace commandLineArgs {} | ||
|
||
export = commandLineArgs; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
declare module 'dom5' { | ||
export interface Node { | ||
nodeName: string; | ||
tagName: string; | ||
childNodes: Node[]; | ||
parentNode: Node; | ||
attrs: Attr[]; | ||
value?: string; | ||
data?: string; | ||
__location?: { | ||
start: number; | ||
} | ||
} | ||
export interface Attr { | ||
name: string; | ||
value: string; | ||
} | ||
interface ParseOptions { | ||
locationInfo: boolean; | ||
} | ||
|
||
export function parse(text: string, opts?: ParseOptions):Node; | ||
export function parseFragment(text: string, opts?: ParseOptions):Node; | ||
|
||
export function serialize(node: Node): string; | ||
|
||
export type Predicate = (n:Node) => boolean; | ||
export function query(root: Node, predicate: Predicate):Node; | ||
export function queryAll(root: Node, predicate: Predicate):Node[]; | ||
export function nodeWalk(node: Node, predicate: Predicate):Node; | ||
export function nodeWalkAll(node: Node, predicate: Predicate):Node[]; | ||
export function nodeWalkAllPrior(node: Node, predicate: Predicate):Node[]; | ||
export function nodeWalkPrior(node: Node, predicate: Predicate): Node; | ||
export function treeMap(node: Node, walker:(node: Node)=>void):void; | ||
export function getAttribute(node: Node, attrName: string): string; | ||
export function removeAttribute(node: Node, attrName: string): string; | ||
export function getTextContent(node: Node): string; | ||
export function setTextContent(node: Node, string: string): void; | ||
export function append(parent: Node, newNode: Node): void; | ||
export function remove(willBeRemoved: Node): void; | ||
export function replace(current: Node, replacement: Node): void; | ||
export function isTextNode(node: Node): boolean; | ||
|
||
|
||
export var isCommentNode: Predicate; | ||
interface PredicateCombinators { | ||
hasTagName(name: string):Predicate; | ||
hasAttr(name: string): Predicate; | ||
hasAttrValue(name: string, value: string): Predicate; | ||
parentMatches(predicateFn: Predicate): Predicate; | ||
hasTextValue(value:string): Predicate; | ||
hasMatchingTagName(regex:RegExp): boolean; | ||
NOT(pred: Predicate):Predicate; | ||
AND(...preds: Predicate[]):Predicate; | ||
OR(...preds: Predicate[]):Predicate; | ||
} | ||
export var predicates: PredicateCombinators; | ||
|
||
interface Constructors { | ||
element(tagName: string): Node; | ||
text(content: string): Node; | ||
} | ||
export var constructors: Constructors; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
declare module "hydrolysis" { | ||
interface Options { | ||
filter?: (path: string) => boolean; | ||
} | ||
interface Element { | ||
is: string; | ||
contentHref: string; | ||
desc?: string; | ||
} | ||
interface Behavior { | ||
is: string; | ||
contentHref: string; | ||
desc?: string; | ||
} | ||
export class Analyzer { | ||
static analyze(path: string, options: Options): Promise<Analyzer>; | ||
metadataTree(path: string): Promise<void>; | ||
annotate(): void; | ||
elements: Element[]; | ||
behaviors: Behavior[]; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Favor let over var wherever possible.
Create a new variable name instead of avoiding type checks for contents.