Skip to content

Commit

Permalink
flow update
Browse files Browse the repository at this point in the history
  • Loading branch information
SheetJSDev committed Apr 21, 2018
1 parent f032f34 commit 75c49dd
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 22 deletions.
3 changes: 0 additions & 3 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,3 @@ module.file_ext=.js
module.file_ext=.njs
module.ignore_non_literal_requires=true
suppress_comment= \\(.\\|\n\\)*\\$FlowIgnore

[lints]
deprecated-declare-exports=off
6 changes: 3 additions & 3 deletions bits/05_buf.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ function new_raw_buf(len/*:number*/) {
/* jshint +W056 */
}

function s2a(s/*:string*/) {
function s2a(s/*:string*/)/*:any*/ {
if(has_buf) return new Buffer(s, "binary");
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
return s.split("").map(function(x/*:string*/)/*:number*/{ return x.charCodeAt(0) & 0xff; });
}

function s2ab(s/*:string*/) {
function s2ab(s/*:string*/)/*:any*/ {
if(typeof ArrayBuffer === 'undefined') return s2a(s);
var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);
for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
Expand Down
1 change: 0 additions & 1 deletion bits/35_custprops.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ function write_cust_props(cp/*::, opts*/)/*:string*/ {
if(!cp) return o.join("");
var pid = 1;
keys(cp).forEach(function custprop(k) { ++pid;
// $FlowIgnore
o[o.length] = (writextag('property', write_vt(cp[k]), {
'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}',
'pid': pid,
Expand Down
2 changes: 1 addition & 1 deletion bits/48_stybin.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ function parse_BrtFont(data, length/*:number*/, opts) {

return out;
}
function write_BrtFont(font, o) {
function write_BrtFont(font/*:any*/, o) {
if(!o) o = new_buf(25+4*32);
o.write_shift(2, font.sz * 20);
write_FontFlags(font, o);
Expand Down
5 changes: 5 additions & 0 deletions misc/flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ type WBWBProps = {
Names?: Array<any>;
Views?: Array<any>;
WBProps?: WBProps;
SheetNames?: Array<string>;
};
type WBProps = {
Expand Down Expand Up @@ -61,6 +62,8 @@ type WBWSProp = {
interface CellAddress {
r:number;
c:number;
cRel?:boolean;
rRel?:boolean;
};
type CellAddrSpec = CellAddress | string;
Expand Down Expand Up @@ -122,6 +125,8 @@ type ColInfo = {
wch?:number; // width in characters
MDW?:number; // Excel's "Max Digit Width" unit, always integral
customWidth?:boolean;
};
interface Margins {
Expand Down
16 changes: 8 additions & 8 deletions misc/flowdeps.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/*::
declare module 'exit-on-epipe' {};
declare module 'xlsx' { declare var exports:XLSXModule; };
declare module '../' { declare var exports:XLSXModule; };
declare module 'commander' { declare var exports:any; };
declare module './jszip.js' { declare var exports:any; };
declare module './dist/cpexcel.js' { declare var exports:any; };
declare module 'crypto' { declare var exports:any; };
declare module 'fs' { declare var exports:any; };
declare module 'xlsx' { declare module.exports:XLSXModule; };
declare module '../' { declare module.exports:XLSXModule; };
declare module 'commander' { declare module.exports:any; };
declare module './jszip.js' { declare module.exports:any; };
declare module './dist/cpexcel.js' { declare module.exports:any; };
declare module 'crypto' { declare module.exports:any; };
declare module 'fs' { declare module.exports:any; };
type ZIP = any;
Expand Down
9 changes: 4 additions & 5 deletions xlsx.flow.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ function new_raw_buf(len/*:number*/) {
/* jshint +W056 */
}

function s2a(s/*:string*/) {
function s2a(s/*:string*/)/*:any*/ {
if(has_buf) return new Buffer(s, "binary");
return s.split("").map(function(x){ return x.charCodeAt(0) & 0xff; });
return s.split("").map(function(x/*:string*/)/*:number*/{ return x.charCodeAt(0) & 0xff; });
}

function s2ab(s/*:string*/) {
function s2ab(s/*:string*/)/*:any*/ {
if(typeof ArrayBuffer === 'undefined') return s2a(s);
var buf = new ArrayBuffer(s.length), view = new Uint8Array(buf);
for (var i=0; i!=s.length; ++i) view[i] = s.charCodeAt(i) & 0xFF;
Expand Down Expand Up @@ -4194,7 +4194,6 @@ function write_cust_props(cp/*::, opts*/)/*:string*/ {
if(!cp) return o.join("");
var pid = 1;
keys(cp).forEach(function custprop(k) { ++pid;
// $FlowIgnore
o[o.length] = (writextag('property', write_vt(cp[k]), {
'fmtid': '{D5CDD505-2E9C-101B-9397-08002B2CF9AE}',
'pid': pid,
Expand Down Expand Up @@ -8247,7 +8246,7 @@ function parse_BrtFont(data, length/*:number*/, opts) {

return out;
}
function write_BrtFont(font, o) {
function write_BrtFont(font/*:any*/, o) {
if(!o) o = new_buf(25+4*32);
o.write_shift(2, font.sz * 20);
write_FontFlags(font, o);
Expand Down
1 change: 0 additions & 1 deletion xlsx.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 75c49dd

Please sign in to comment.