Add more JS API wrappers

This commit is contained in:
Alexey Andreev 2018-06-19 22:38:21 +03:00
parent f2adb9dbdd
commit 243901ec10
3 changed files with 158 additions and 0 deletions

View File

@ -0,0 +1,66 @@
/*
* Copyright 2018 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.teavm.jso.dom.html;
import org.teavm.jso.JSProperty;
import org.teavm.jso.dom.types.DOMTokenList;
public interface HTMLAnchorElement extends HTMLElement {
@JSProperty
String getHref();
@JSProperty
void setHref(String value);
@JSProperty
String getTarget();
@JSProperty
void setTarget(String value);
@JSProperty
String getRel();
@JSProperty
void setRel(String value);
@JSProperty
DOMTokenList getTokenList();
@JSProperty
String getMedia();
@JSProperty
void setMedia(String value);
@JSProperty
String getHreflang();
@JSProperty
void setHreflang(String value);
@JSProperty
String getType();
@JSProperty
void setType(String value);
@JSProperty
String getText();
@JSProperty
void setText(String value);
}

View File

@ -0,0 +1,56 @@
/*
* Copyright 2018 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.teavm.jso.dom.html;
import org.teavm.jso.JSProperty;
public interface HTMLScriptElement extends HTMLElement {
@JSProperty
String getSrc();
@JSProperty
void setSrc(String value);
@JSProperty
boolean isAsync();
@JSProperty
void setAsync(boolean value);
@JSProperty
boolean isDefer();
@JSProperty
void setDefer(boolean value);
@JSProperty
String getType();
@JSProperty
void setType(String value);
@JSProperty
String getCharset();
@JSProperty
void setCharset(String value);
@JSProperty
String getText();
@JSProperty
void setText(String value);
}

View File

@ -0,0 +1,36 @@
/*
* Copyright 2018 Alexey Andreev.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.teavm.jso.dom.types;
import org.teavm.jso.JSIndexer;
import org.teavm.jso.JSObject;
import org.teavm.jso.JSProperty;
public interface DOMTokenList extends JSObject {
@JSProperty
int getLength();
@JSIndexer
String item(int index);
boolean contains(String token);
void add(String token);
void remove(String token);
boolean toggle(String token);
}