Skip to content

Commit

Permalink
#1657: Refine types for reading resources for generic / Java platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
davidpcaldwell committed Sep 11, 2024
1 parent aba1887 commit 4269874
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions jrunscript/io/grid.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace slime.jrunscript.io.internal.grid {
}

namespace slime.jrunscript.io.grid.excel {
export type Format = (p: { resource: slime.Resource }) => slime.jrunscript.native.org.apache.poi.POIDocument
export type Format = (p: { resource: slime.jrunscript.runtime.old.Resource }) => slime.jrunscript.native.org.apache.poi.POIDocument

interface Cell {
getValue(): string | number
Expand Down Expand Up @@ -55,7 +55,7 @@ namespace slime.jrunscript.io.grid.excel {
xlsx: Format
}
Workbook: {
(p: { resource: slime.Resource, format?: Format }): Workbook
(p: { resource: slime.jrunscript.runtime.old.Resource, format?: Format }): Workbook
}
toJavascriptDate: (num: number) => Date
}
Expand Down
6 changes: 0 additions & 6 deletions loader/expression.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,12 +187,6 @@ namespace slime {
*/
(p: slime.external.e4x.XMLConstructor): slime.external.e4x.XML

// TODO Java-specific
(p: slime.jrunscript.PropertiesJavaClass): slime.jrunscript.native.java.util.Properties

// TODO Java-specific
(p: slime.jrunscript.runtime.io.Exports["Streams"]["binary"]): slime.jrunscript.runtime.io.InputStream

/**
* Returns the content of this resource as a string.
*/
Expand Down
8 changes: 7 additions & 1 deletion loader/jrunscript/expression.fifty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,12 @@ namespace slime.jrunscript.runtime {
* implementation from the SLIME runtime Resource.
*/
read: slime.Resource["read"] & {
// TODO Java-specific
(p: slime.jrunscript.PropertiesJavaClass): slime.jrunscript.native.java.util.Properties

// TODO Java-specific
(p: slime.jrunscript.runtime.io.Exports["Streams"]["binary"]): slime.jrunscript.runtime.io.InputStream

/**
* (if content can be read as a byte stream) Reads the content of this resource as a byte stream.
* @returns A stream that can provide the content of this resource.
Expand Down Expand Up @@ -188,7 +194,7 @@ namespace slime.jrunscript.runtime {
read: {
string: function() { return lines.join("\n"); }
}
});
}) as slime.jrunscript.runtime.old.Resource;
var _properties = resource.read(Packages.java.util.Properties);
var properties = {
getProperty: function(name) {
Expand Down

0 comments on commit 4269874

Please sign in to comment.