mirror of
https://github.com/catppuccin/catppuccin
synced 2024-11-14 15:57:09 +00:00
b9bbd77c7f
* docs: restructure & improve contrib docs * chore: rework samples code * docs: fix capitalization & brand names * docs: PR comments & try to standardise palette vs flavor * docs: add sample-programs * docs: update submission guidelines (refs: #1821) * refactor: tidy up docs Co-authored-by: winston <hey@winston.sh>
54 lines
1.3 KiB
TypeScript
54 lines
1.3 KiB
TypeScript
module ModuleValidator {
|
|
import checkChars = CharUtils.notWhiteSpace
|
|
|
|
export interface HasValidator<T> {
|
|
validateValue(): Boolean;
|
|
}
|
|
|
|
type FooBarAlias = string;
|
|
|
|
@decorator()
|
|
class HasValidator implements HasValidator<String> {
|
|
/* Processed values */
|
|
static validatedValue: Array<String> = ['', 'aa']
|
|
private myValue: String
|
|
|
|
/**
|
|
* Constructor for class
|
|
* @param valueParameter Value for <i>validation</i>
|
|
*/
|
|
constructor(valueParameter: String) {
|
|
this.myValue = valueParameter
|
|
HasValidator.validatedValue.push(value)
|
|
}
|
|
|
|
public validateValue(): Boolean {
|
|
var resultValue: Boolean = checkChars(this.myValue)
|
|
return resultValue
|
|
}
|
|
|
|
static createInstance(valueParameter: string): HasValidator {
|
|
return new HasValidator(valueParameter)
|
|
}
|
|
}
|
|
|
|
function globalFunction<TypeParameter>(value: TypeParameter) { //global function
|
|
return 42
|
|
}
|
|
|
|
declare var declareUrl
|
|
var varUrl = declareUrl.replace(/^\s*(.*)/, '$1').concat('\u1111\z\n\u22')
|
|
var html = `<div title='HTML injection'>Injected language fragment</div>`
|
|
var hello = () => console.log('hello')
|
|
HasValidator.createInstance(varUrl).validateValue()
|
|
|
|
function acceptsUnion(s: string | number) {
|
|
if (typeof s === 'string') {
|
|
s
|
|
}
|
|
}
|
|
|
|
enum EnumName {
|
|
EnumMember
|
|
}
|
|
}
|