Transform PHP types to JavaScript